[systemd-commits] 2 commits - src/libsystemd

Tom Gundersen tomegun at kemper.freedesktop.org
Tue Apr 14 07:19:42 PDT 2015


 src/libsystemd/sd-device/sd-device.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 85091685af65831f379580c75b40776c20e245ee
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue Apr 14 16:05:53 2015 +0200

    sd-device: fix reading of subsystem

diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index 7d52e3c..d420bd0 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -772,10 +772,10 @@ _public_ int sd_device_get_subsystem(sd_device *device, const char **ret) {
                         r = device_set_subsystem(device, "drivers");
                 else if (path_startswith(device->devpath, "/subsystem/") ||
                          path_startswith(device->devpath, "/class/") ||
-                         path_startswith(device->devpath, "/buss/"))
+                         path_startswith(device->devpath, "/bus/"))
                         r = device_set_subsystem(device, "subsystem");
                 if (r < 0)
-                        return r;
+                        return log_debug_errno(r, "sd-devcie: could not set subsystem for %s: %m", device->devpath);
 
                 device->subsystem_set = true;
         }

commit bba061662b0f759abb43bad60c9733305c191045
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue Apr 14 15:15:49 2015 +0200

    sd-device: allow uevent files to be write-only

diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index b828fa8..7d52e3c 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -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;
         }



More information about the systemd-commits mailing list