diff options
author | Felipe Sateler <fsateler@debian.org> | 2019-02-20 21:24:33 -0300 |
---|---|---|
committer | Felipe Sateler <fsateler@debian.org> | 2019-02-20 21:24:33 -0300 |
commit | 7c20daf69c4411979b7f8902f3601d1cdc56cc07 (patch) | |
tree | d59b9989ce55ed23693e80974d94c856f1c2c8b1 /src/udev/udevadm-info.c | |
parent | 6e866b331d7cd4a5e0759dd160dea6edabd3678e (diff) | |
download | systemd-7c20daf69c4411979b7f8902f3601d1cdc56cc07.tar.gz |
New upstream version 241upstream/241
Diffstat (limited to 'src/udev/udevadm-info.c')
-rw-r--r-- | src/udev/udevadm-info.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index d141bc74b2..ebd15d384a 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -61,12 +61,15 @@ static bool skip_attribute(const char *name) { static void print_all_attributes(sd_device *device, const char *key) { const char *name, *value; - FOREACH_DEVICE_PROPERTY(device, name, value) { + FOREACH_DEVICE_SYSATTR(device, name) { size_t len; if (skip_attribute(name)) continue; + if (sd_device_get_sysattr_value(device, name, &value) < 0) + continue; + /* skip any values that look like a path */ if (value[0] == '/') continue; @@ -387,10 +390,8 @@ int info_main(int argc, char *argv[], void *userdata) { query = QUERY_PATH; else if (streq(optarg, "all")) query = QUERY_ALL; - else { - log_error("unknown query type"); - return -EINVAL; - } + else + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "unknown query type"); break; case 'r': arg_root = true; @@ -413,6 +414,7 @@ int info_main(int argc, char *argv[], void *userdata) { arg_export = true; break; case 'P': + arg_export = true; arg_export_prefix = optarg; break; case 'V': @@ -425,7 +427,6 @@ int info_main(int argc, char *argv[], void *userdata) { assert_not_reached("Unknown option"); } - if (action == ACTION_DEVICE_ID_FILE) { if (argv[optind]) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), |