]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: make use of the fact that log_debug_errno() returns the error passed in 8554/head
authorLennart Poettering <lennart@poettering.net>
Thu, 22 Mar 2018 18:59:49 +0000 (19:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 22 Mar 2018 18:59:49 +0000 (19:59 +0100)
src/libsystemd/sd-device/sd-device.c

index 1297dfa91116963b0c1ebbcf95b904a95d0c9460..cf6ce3632f5a5012334429984b53c45fc0bb4666 100644 (file)
@@ -168,12 +168,9 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
         if (verify) {
                 r = chase_symlinks(_syspath, NULL, 0, &syspath);
                 if (r == -ENOENT)
-                        /* the device does not exist (any more?) */
-                        return -ENODEV;
-                else if (r < 0) {
-                        log_debug_errno(r, "sd-device: could not get target of '%s': %m", _syspath);
-                        return r;
-                }
+                        return -ENODEV; /* the device does not exist (any more?) */
+                if (r < 0)
+                        return log_debug_errno(r, "sd-device: could not get target of '%s': %m", _syspath);
 
                 if (!path_startswith(syspath, "/sys")) {
                         _cleanup_free_ char *real_sys = NULL, *new_syspath = NULL;