From d89e0dc81ad6f7946af612137ed3bae02dbdc464 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Mar 2018 19:59:49 +0100 Subject: [PATCH] sd-device: make use of the fact that log_debug_errno() returns the error passed in --- src/libsystemd/sd-device/sd-device.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 1297dfa9111..cf6ce3632f5 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -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;