]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Fix three uses of bogus errno value in logs (and returned value in one case)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 Apr 2018 11:45:44 +0000 (13:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 Apr 2018 12:10:27 +0000 (14:10 +0200)
src/activate/activate.c
src/core/bpf-firewall.c

index eefea277208f8507f3a7cf21ef2c3deb5a408fc5..d598965b477215a259aa6ad3c09cb1a274afc4fd 100644 (file)
@@ -186,7 +186,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
 
                 r = rearrange_stdio(start_fd, start_fd, STDERR_FILENO); /* invalidates start_fd on success + error */
                 if (r < 0)
-                        return log_error_errno(errno, "Failed to move fd to stdin+stdout: %m");
+                        return log_error_errno(r, "Failed to move fd to stdin+stdout: %m");
 
         } else {
                 if (start_fd != SD_LISTEN_FDS_START) {
index 22cd8e9158bdae0238ed97fc073f45d0a5ceb677..b830b393b332d2cb9b8d43c99b7ad80c7297d831 100644 (file)
@@ -691,13 +691,14 @@ int bpf_firewall_supported(void) {
                          1,
                          BPF_F_NO_PREALLOC);
         if (fd < 0) {
-                log_debug_errno(r, "Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: %m");
+                log_debug_errno(fd, "Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: %m");
                 return supported = BPF_FIREWALL_UNSUPPORTED;
         }
 
         safe_close(fd);
 
-        if (bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, &program) < 0) {
+        r = bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, &program);
+        if (r < 0) {
                 log_debug_errno(r, "Can't allocate CGROUP SKB BPF program, BPF firewalling is not supported: %m");
                 return supported = BPF_FIREWALL_UNSUPPORTED;
         }