static void print_all_attributes(struct udev_device *device, const char *key)
{
+ struct udev *udev = udev_device_get_udev(device);
struct udev_list_entry *sysattr;
udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
- struct udev *udev = udev_device_get_udev(device);
const char *name;
const char *value;
size_t len;
continue;
dbg(udev, "attr '%s'='%s'\n", name, value);
+ /* skip any values that look like a path */
+ if (value[0] == '/')
+ continue;
+
/* skip nonprintable attributes */
len = strlen(value);
while (len > 0 && isprint(value[len-1]))
}
}
-int udevadm_info(struct udev *udev, int argc, char *argv[])
+static int uinfo(struct udev *udev, int argc, char *argv[])
{
struct udev_device *device = NULL;
bool root = 0;
" --help\n\n");
goto exit;
default:
+ rc = 1;
goto exit;
}
}
udev_device_unref(device);
return rc;
}
+
+const struct udevadm_cmd udevadm_info = {
+ .name = "info",
+ .cmd = uinfo,
+ .help = "query sysfs or the udev database",
+};