diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-10-24 19:12:55 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-10-24 21:08:17 +0200 |
commit | f5dfbdd01427c49ec66110ac5f33e317bcea7a78 (patch) | |
tree | f2debf5e5a3f1dc23ce67f777f1b8cf8b017a59e /src/udev/udev-watch.c | |
parent | mkosi: libbpf0 -> libbpf1 (diff) | |
download | systemd-f5dfbdd01427c49ec66110ac5f33e317bcea7a78.tar.xz systemd-f5dfbdd01427c49ec66110ac5f33e317bcea7a78.zip |
udev: fix the errno check if a couple of places
Follow-up to 691a596da15.
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r-- | src/udev/udev-watch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index 2a9ff2909b..abd1d8fea5 100644 --- a/src/udev/udev-watch.c +++ b/src/udev/udev-watch.c @@ -155,7 +155,7 @@ static int udev_watch_clear(sd_device *dev, int dirfd, int *ret_wd) { * In the above, we already confirmed that the symlink is owned by us. Hence, no other workers remove * the symlink and cannot create a new symlink with the same filename but to a different ID. Hence, * the removal below is safe even the steps in this function are not atomic. */ - if (unlinkat(dirfd, wd_str, 0) < 0 && errno != -ENOENT) + if (unlinkat(dirfd, wd_str, 0) < 0 && errno != ENOENT) log_device_debug_errno(dev, errno, "Failed to remove '/run/udev/watch/%s', ignoring: %m", wd_str); if (ret_wd) @@ -165,7 +165,7 @@ static int udev_watch_clear(sd_device *dev, int dirfd, int *ret_wd) { finalize: /* 5. remove symlink ID -> wd. * The file is always owned by the device. Hence, it is safe to remove it unconditionally. */ - if (unlinkat(dirfd, id, 0) < 0 && errno != -ENOENT) + if (unlinkat(dirfd, id, 0) < 0 && errno != ENOENT) log_device_debug_errno(dev, errno, "Failed to remove '/run/udev/watch/%s': %m", id); return r; |