chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rules: add "do not edit" comment
[elogind.git]
/
udevinfo.c
diff --git
a/udevinfo.c
b/udevinfo.c
index 4b4876cc11f10e03cad5efb5555da04dc382d116..d0b1c447f4d65f2692b026996333dbf58f8f0328 100644
(file)
--- a/
udevinfo.c
+++ b/
udevinfo.c
@@
-93,7
+93,7
@@
static void print_all_attributes(const char *devpath, const char *key)
continue;
}
continue;
}
- replace_
untrusted_chars(value
);
+ replace_
chars(value, ALLOWED_CHARS_INPUT
);
printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value);
}
}
printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value);
}
}
@@
-144,9
+144,14
@@
static void print_record(struct udevice *udev)
printf("P: %s\n", udev->dev->devpath);
printf("N: %s\n", udev->name);
printf("P: %s\n", udev->dev->devpath);
printf("N: %s\n", udev->name);
- printf("L: %i\n", udev->link_priority);
list_for_each_entry(name_loop, &udev->symlink_list, node)
printf("S: %s\n", name_loop->name);
list_for_each_entry(name_loop, &udev->symlink_list, node)
printf("S: %s\n", name_loop->name);
+ if (udev->link_priority != 0)
+ printf("L: %i\n", udev->link_priority);
+ if (udev->partitions != 0)
+ printf("A:%u\n", udev->partitions);
+ if (udev->ignore_remove)
+ printf("R:%u\n", udev->ignore_remove);
list_for_each_entry(name_loop, &udev->env_list, node)
printf("E: %s\n", name_loop->name);
}
list_for_each_entry(name_loop, &udev->env_list, node)
printf("E: %s\n", name_loop->name);
}
@@
-260,7
+265,6
@@
int main(int argc, char *argv[], char *envp[])
goto exit;
}
goto exit;
}
- /* get command line options */
while (1) {
option = getopt_long(argc, argv, "aen:p:q:rVh", options, NULL);
if (option == -1)
while (1) {
option = getopt_long(argc, argv, "aen:p:q:rVh", options, NULL);
if (option == -1)
@@
-274,7
+278,7
@@
int main(int argc, char *argv[], char *envp[])
strlcpy(name, &optarg[strlen(udev_root)+1], sizeof(name));
else
strlcpy(name, optarg, sizeof(name));
strlcpy(name, &optarg[strlen(udev_root)+1], sizeof(name));
else
strlcpy(name, optarg, sizeof(name));
- dbg("name: %s
\n
", name);
+ dbg("name: %s", name);
break;
case 'p':
/* remove /sys if given */
break;
case 'p':
/* remove /sys if given */
@@
-282,10
+286,9
@@
int main(int argc, char *argv[], char *envp[])
strlcpy(path, &optarg[strlen(sysfs_path)], sizeof(path));
else
strlcpy(path, optarg, sizeof(path));
strlcpy(path, &optarg[strlen(sysfs_path)], sizeof(path));
else
strlcpy(path, optarg, sizeof(path));
- dbg("path: %s
\n
", path);
+ dbg("path: %s", path);
break;
case 'q':
break;
case 'q':
- dbg("udev query: %s\n", optarg);
action = ACTION_QUERY;
if (strcmp(optarg, "name") == 0) {
query = QUERY_NAME;
action = ACTION_QUERY;
if (strcmp(optarg, "name") == 0) {
query = QUERY_NAME;
@@
-408,7
+411,7
@@
int main(int argc, char *argv[], char *envp[])
case ACTION_ATTRIBUTE_WALK:
if (path[0] != '\0') {
if (print_device_chain(path) != 0) {
case ACTION_ATTRIBUTE_WALK:
if (path[0] != '\0') {
if (print_device_chain(path) != 0) {
- fprintf(stderr, "
device not
found\n");
+ fprintf(stderr, "
no valid sysfs device
found\n");
rc = 4;
goto exit;
}
rc = 4;
goto exit;
}
@@
-419,7
+422,7
@@
int main(int argc, char *argv[], char *envp[])
goto exit;
}
if (print_device_chain(udev->dev->devpath) != 0) {
goto exit;
}
if (print_device_chain(udev->dev->devpath) != 0) {
- fprintf(stderr, "
device not
found\n");
+ fprintf(stderr, "
no valid sysfs device
found\n");
rc = 4;
goto exit;
}
rc = 4;
goto exit;
}