]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
initctl: fix error handling
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Mar 2025 16:32:12 +0000 (01:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Mar 2025 16:44:01 +0000 (01:44 +0900)
Fixes a bug introduced by cc090ca7fec93cd6b41bd7a756cd5fe32df44764 (v246).

src/initctl/initctl.c

index 8ed5f1e26416ce682bc7e9435c80864e2e5413f6..f0f722ac3ef4433a7e2b11b68955355a400094f7 100644 (file)
@@ -318,8 +318,7 @@ static int run(int argc, char *argv[]) {
 
         n = sd_listen_fds(true);
         if (n < 0)
-                return log_error_errno(errno,
-                                       "Failed to read listening file descriptors from environment: %m");
+                return log_error_errno(n, "Failed to read listening file descriptors from environment: %m");
 
         if (n <= 0 || n > SERVER_FD_MAX)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),