]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udevadm-info.c
udevadm: don't claim a sysattr was write only just because we get EPERM on read
[thirdparty/systemd.git] / src / udev / udevadm-info.c
index 5ae33e101ae17d27089028d38edc6f6618a3c30c..992764b80ce64d56c0116cac5777f93f75553ce0 100644 (file)
@@ -16,6 +16,7 @@
 #include "device-private.h"
 #include "device-util.h"
 #include "dirent-util.h"
+#include "errno-util.h"
 #include "fd-util.h"
 #include "sort-util.h"
 #include "static-destruct.h"
@@ -117,8 +118,8 @@ static int print_all_attributes(sd_device *device, bool is_parent) {
                         if (len > 0)
                                 continue;
 
-                } else if (r == -EPERM)
-                        value = "(write-only)";
+                } else if (ERRNO_IS_PRIVILEGE(r))
+                        value = "(not readable)";
                 else
                         continue;