chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
554dde8
)
udevinfo: allow -a -n <node>
author
Kay Sievers
<kay.sievers@suse.de>
Fri, 18 Aug 2006 00:31:37 +0000
(
02:31
+0200)
committer
Kay Sievers
<kay.sievers@suse.de>
Fri, 18 Aug 2006 00:31:37 +0000
(
02:31
+0200)
udevinfo.c
patch
|
blob
|
history
diff --git
a/udevinfo.c
b/udevinfo.c
index e0ea5fb4ed921df61fe4a3eb6cc2e4408dd67cb7..6b7368119f821ae87d1b949dffc0f1fcd9fd0012 100644
(file)
--- a/
udevinfo.c
+++ b/
udevinfo.c
@@
-376,12
+376,22
@@
int main(int argc, char *argv[], char *envp[])
}
break;
case ACTION_ATTRIBUTE_WALK:
}
break;
case ACTION_ATTRIBUTE_WALK:
- if (path[0] == '\0') {
- fprintf(stderr, "attribute walk on device chain needs path(-p) specified\n");
- rc = 4;
- goto exit;
- } else
+ if (path[0] != '\0') {
print_device_chain(path);
print_device_chain(path);
+ } else if (name[0] != '\0') {
+ char devpath[PATH_SIZE];
+
+ if (udev_db_lookup_name(name, devpath, sizeof(devpath)) != 0) {
+ fprintf(stderr, "node name not found\n");
+ rc = 4;
+ goto exit;
+ }
+ print_device_chain(devpath);
+ } else {
+ fprintf(stderr, "attribute walk needs device path(-p) or node name(-n) specified\n");
+ rc = 5;
+ goto exit;
+ }
break;
case ACTION_ROOT:
printf("%s\n", udev_root);
break;
case ACTION_ROOT:
printf("%s\n", udev_root);