chiark / gitweb /
sd-device: allow uevent files to be write-only
authorTom Gundersen <teg@jklm.no>
Tue, 14 Apr 2015 13:15:49 +0000 (15:15 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 07:05:08 +0000 (08:05 +0100)
src/libelogind/sd-device/sd-device.c

index b828fa8..7d52e3c 100644 (file)
@@ -499,7 +499,10 @@ int device_read_uevent_file(sd_device *device) {
         path = strjoina(syspath, "/uevent");
 
         r = read_full_file(path, &uevent, &uevent_len);
-        if (r < 0) {
+        if (r == -EACCES)
+                /* empty uevent files may be write-only */
+                return 0;
+        else if (r < 0) {
                 log_debug("sd-device: failed to read uevent file '%s': %s", path, strerror(-r));
                 return r;
         }