chiark / gitweb /
sd-device: don't complain if the uevent file is missing
authorTom Gundersen <teg@jklm.no>
Sat, 25 Apr 2015 23:04:33 +0000 (01:04 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 07:14:08 +0000 (08:14 +0100)
Only 'real' devices are required to have an uevent file.

src/libelogind/sd-device/sd-device.c

index fd4622987c04f91c15401156b0eadb55e95ab854..9ef851a6bbfcd6ed53839fbc3ecab28b548b3c17 100644 (file)
@@ -510,6 +510,9 @@ int device_read_uevent_file(sd_device *device) {
         if (r == -EACCES)
                 /* empty uevent files may be write-only */
                 return 0;
+        else if (r == -ENOENT)
+                /* some devices may not have uevent files, see set_syspath() */
+                return 0;
         else if (r < 0) {
                 log_debug("sd-device: failed to read uevent file '%s': %s", path, strerror(-r));
                 return r;