diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-10-04 21:05:21 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-10-04 21:26:04 +0200 |
commit | 7c1dd9e288047a69d4a6a6dd6585725410cfdadd (patch) | |
tree | c9c77241ffcfdb258c1318a90c15e91f1624ce10 /src/home | |
parent | Merge pull request #34608 from DaanDeMeyer/ukify (diff) | |
download | systemd-7c1dd9e288047a69d4a6a6dd6585725410cfdadd.tar.xz systemd-7c1dd9e288047a69d4a6a6dd6585725410cfdadd.zip |
various: correct laccess() error check
laccess is our own macro that uses RET_NERRNO.
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homework-luks.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index b859658f00..8ab8dd8cbd 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -1997,11 +1997,11 @@ static int wait_for_devlink(const char *path) { _cleanup_free_ char *dn = NULL; usec_t w; - if (laccess(path, F_OK) < 0) { - if (errno != ENOENT) - return log_error_errno(errno, "Failed to determine whether %s exists: %m", path); - } else + r = laccess(path, F_OK); + if (r >= 0) return 0; /* Found it */ + if (r != -ENOENT) + return log_error_errno(r, "Failed to determine whether %s exists: %m", path); if (inotify_fd < 0) { /* We need to wait for the device symlink to show up, let's create an inotify watch for it */ |