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.
This commit is contained in:
Dmitry V. Levin
2023-07-28 12:28:35 +00:00
parent 6ce691c309
commit 08b8e9130e
2 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -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);