diff options
author | Dmitry V. Levin <ldv@strace.io> | 2023-07-14 10:00:00 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-07-28 14:28:35 +0200 |
commit | 08b8e9130e7fe7bf4149a3abc86b6b12e693721f (patch) | |
tree | 069147ed263e049d154f869c2e3741194a10c5a8 /src/tmpfiles | |
parent | repart: cleanup use of ERRNO_IS_NOT_SUPPORTED() (diff) | |
download | systemd-08b8e9130e7fe7bf4149a3abc86b6b12e693721f.tar.xz systemd-08b8e9130e7fe7bf4149a3abc86b6b12e693721f.zip |
btrfs-util,tmpfiles: cleanup use of ERRNO_IS_NOT_SUPPORTED()
Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.
In this case the arguments passed to ERRNO_IS_NOT_SUPPORTED() are the
values returned by btrfs_subvol_make_fd() which is not expected to
return any positive values, but let's be consistent anyway and move
ERRNO_IS_NOT_SUPPORTED() invocations to the branches where
the return values are known to be negative.
Diffstat (limited to 'src/tmpfiles')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index a7de3c87fe..978d371268 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1883,7 +1883,7 @@ static int create_directory_or_subvolume( } else r = 0; - if (!subvol || ERRNO_IS_NOT_SUPPORTED(r)) + if (!subvol || (r < 0 && ERRNO_IS_NOT_SUPPORTED(r))) WITH_UMASK(0000) r = mkdirat_label(pfd, bn, mode); |