1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 09:56:51 +03:00

sd-device: make use of the fact that log_debug_errno() returns the error passed in

This commit is contained in:
Lennart Poettering 2018-03-22 19:59:49 +01:00
parent 62570f6f03
commit d89e0dc81a

View 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;