chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove last sbindir use
[elogind.git]
/
udev
/
udevadm-info.c
diff --git
a/udev/udevadm-info.c
b/udev/udevadm-info.c
index a6387d07aecaa11c8e0b2456c644332f85421348..f7e7e86b6a4a8f43cf9207b85f4176ab4874191c 100644
(file)
--- a/
udev/udevadm-info.c
+++ b/
udev/udevadm-info.c
@@
-52,10
+52,10
@@
static bool skip_attribute(const char *name)
static void print_all_attributes(struct udev_device *device, const char *key)
{
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_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;
const char *name;
const char *value;
size_t len;
@@
-69,6
+69,10
@@
static void print_all_attributes(struct udev_device *device, const char *key)
continue;
dbg(udev, "attr '%s'='%s'\n", name, value);
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]))
/* skip nonprintable attributes */
len = strlen(value);
while (len > 0 && isprint(value[len-1]))
@@
-275,7
+279,7
@@
static void cleanup_db(struct udev *udev)
}
}
}
}
-
int udevadm_
info(struct udev *udev, int argc, char *argv[])
+
static int u
info(struct udev *udev, int argc, char *argv[])
{
struct udev_device *device = NULL;
bool root = 0;
{
struct udev_device *device = NULL;
bool root = 0;
@@
-556,3
+560,9
@@
exit:
udev_device_unref(device);
return rc;
}
udev_device_unref(device);
return rc;
}
+
+const struct udevadm_cmd udevadm_info = {
+ .name = "info",
+ .cmd = uinfo,
+ .help = "query sysfs or the udev database",
+};