diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-04-20 01:16:24 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-04-20 01:16:24 +0200 |
commit | fde8fb7466a890aa9c29dddc5f559934b5aa28eb (patch) | |
tree | 8ea456fe33df1164482d7c2496609e342f214715 /src/shared/vpick.c | |
parent | shared/vpick: use strdup_to where appropriate (diff) | |
download | systemd-fde8fb7466a890aa9c29dddc5f559934b5aa28eb.tar.xz systemd-fde8fb7466a890aa9c29dddc5f559934b5aa28eb.zip |
shared/vpick: flatten errno check
Diffstat (limited to '')
-rw-r--r-- | src/shared/vpick.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shared/vpick.c b/src/shared/vpick.c index 0f90af0fd0..fe332189be 100644 --- a/src/shared/vpick.c +++ b/src/shared/vpick.c @@ -292,13 +292,12 @@ static int make_choice( return log_oom_debug(); r = chaseat(toplevel_fd, p, CHASE_AT_RESOLVE_IN_ROOT, &object_path, &object_fd); - if (r < 0) { - if (r != -ENOENT) - return log_debug_errno(r, "Failed to open '%s': %m", prefix_roota(toplevel_path, p)); - + if (r == -ENOENT) { *ret = PICK_RESULT_NULL; return 0; } + if (r < 0) + return log_debug_errno(r, "Failed to open '%s': %m", prefix_roota(toplevel_path, p)); return pin_choice( toplevel_path, |