]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chattr-util: fix error code
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Feb 2024 11:04:00 +0000 (20:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Feb 2024 15:25:37 +0000 (00:25 +0900)
Follow-up for cf91b9155c20a57bfc756b2b7e1a8f401f2bf16d.

src/basic/chattr-util.c

index c59fb8a84e922f3a7242806123aba7b63c35e743..fe8b9abf91fc01dcda79456cbd125b82f5368b66 100644 (file)
@@ -31,7 +31,7 @@ int chattr_full(
 
         fd = xopenat(dir_fd, path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, /* xopen_flags = */ 0, /* mode = */ 0);
         if (fd < 0)
-                return -errno;
+                return fd;
 
         if (fstat(fd, &st) < 0)
                 return -errno;