]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-tar-extract: fix error value in messages
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 13 Mar 2026 09:11:22 +0000 (10:11 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 13 Mar 2026 17:43:51 +0000 (17:43 +0000)
src/import/test-tar-extract.c

index f7fa06f044f1563e4d27df803eb066ca979a4761..0d44196c38e2564e115c02139cacbc52a44b412e 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "errno-util.h"
 #include "fd-util.h"
 #include "libarchive-util.h"
 #include "main-func.h"
@@ -19,11 +20,11 @@ static int run(int argc, char **argv) {
         if (r < 0)
                 return r;
 
-        _cleanup_close_ int input_fd = open(argv[1], O_RDONLY | O_CLOEXEC);
+        _cleanup_close_ int input_fd = RET_NERRNO(open(argv[1], O_RDONLY | O_CLOEXEC));
         if (input_fd < 0)
                 return log_error_errno(input_fd, "Cannot open %s: %m", argv[1]);
 
-        _cleanup_close_ int output_fd = open(argv[2], O_DIRECTORY | O_CLOEXEC);
+        _cleanup_close_ int output_fd = RET_NERRNO(open(argv[2], O_DIRECTORY | O_CLOEXEC));
         if (output_fd < 0)
                 return log_error_errno(output_fd, "Cannot open %s: %m", argv[2]);