{
struct sysfs_device *dev;
+ dev = sysfs_device_get(devpath);
+ if (dev == NULL)
+ return -1;
+
printf("\n"
"Udevinfo starts with the device specified by the devpath and then\n"
"walks up the chain of parent devices. It prints for every device\n"
"and the attributes from one single parent device.\n"
"\n");
- dev = sysfs_device_get(devpath);
- if (dev == NULL)
- return -1;
-
printf(" looking at device '%s':\n", dev->devpath);
printf(" KERNEL==\"%s\"\n", dev->kernel);
printf(" SUBSYSTEM==\"%s\"\n", dev->subsystem);
" --root prepend to query result or print udev_root\n"
" --attribute-walk print all SYSFS_attributes along the device chain\n"
" --export-db export the content of the udev database\n"
- " --verision print udev version\n"
+ " --version print udev version\n"
" --help print this text\n"
"\n");
goto exit;
break;
case ACTION_ATTRIBUTE_WALK:
if (path[0] != '\0') {
- print_device_chain(path);
+ if (print_device_chain(path) != 0) {
+ fprintf(stderr, "device not found\n");
+ rc = 4;
+ goto exit;
+ }
} else if (name[0] != '\0') {
char devpath[PATH_SIZE];
rc = 4;
goto exit;
}
- print_device_chain(devpath);
+ if (print_device_chain(devpath) != 0) {
+ fprintf(stderr, "device not found\n");
+ rc = 4;
+ goto exit;
+ }
} else {
fprintf(stderr, "attribute walk needs --path or node --name specified\n");
rc = 5;