X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevinfo.c;h=d6f564079f0510687c67576efc52434e0c4af6cf;hp=1a10f9ad073c80f2b58c74717edc70702c0c7da0;hb=95776dc6ec174f47fa4dd4d8abf5d457223e5dd4;hpb=eef7c9a385575375a3e3310900022b37777aeb6c diff --git a/udevinfo.c b/udevinfo.c index 1a10f9ad0..d6f564079 100644 --- a/udevinfo.c +++ b/udevinfo.c @@ -45,7 +45,7 @@ void log_message (int priority, const char *format, ...) } #endif -static void print_all_attributes(const char *devpath) +static void print_all_attributes(const char *devpath, const char *key) { char path[PATH_SIZE]; DIR *dir; @@ -80,7 +80,7 @@ static void print_all_attributes(const char *devpath) } replace_untrusted_chars(value); - printf(" SYSFS{%s}==\"%s\"\n", dent->d_name, value); + printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value); } } printf("\n"); @@ -103,10 +103,10 @@ static int print_device_chain(const char *devpath) return -1; printf(" looking at device '%s':\n", dev->devpath); - printf(" KERNEL==\"%s\"\n", dev->kernel_name); + printf(" KERNEL==\"%s\"\n", dev->kernel); printf(" SUBSYSTEM==\"%s\"\n", dev->subsystem); printf(" DRIVER==\"%s\"\n", dev->driver); - print_all_attributes(dev->devpath); + print_all_attributes(dev->devpath, "ATTR"); /* walk up the chain of devices */ while (1) { @@ -114,11 +114,11 @@ static int print_device_chain(const char *devpath) if (dev == NULL) break; printf(" looking at parent device '%s':\n", dev->devpath); - printf(" ID==\"%s\"\n", dev->kernel_name); - printf(" BUS==\"%s\"\n", dev->subsystem); - printf(" DRIVER==\"%s\"\n", dev->driver); + printf(" KERNELS==\"%s\"\n", dev->kernel); + printf(" SUBSYTEMS==\"%s\"\n", dev->subsystem); + printf(" DRIVERS==\"%s\"\n", dev->driver); - print_all_attributes(dev->devpath); + print_all_attributes(dev->devpath, "ATTRS"); } return 0;