Skip to content

Commit 4355f1c

Browse files
committed
Fix three uses of bogus errno value in logs (and returned value in one case)
1 parent b1c05b9 commit 4355f1c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/activate/activate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
186186

187187
r = rearrange_stdio(start_fd, start_fd, STDERR_FILENO); /* invalidates start_fd on success + error */
188188
if (r < 0)
189-
return log_error_errno(errno, "Failed to move fd to stdin+stdout: %m");
189+
return log_error_errno(r, "Failed to move fd to stdin+stdout: %m");
190190

191191
} else {
192192
if (start_fd != SD_LISTEN_FDS_START) {

src/core/bpf-firewall.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,14 @@ int bpf_firewall_supported(void) {
691691
1,
692692
BPF_F_NO_PREALLOC);
693693
if (fd < 0) {
694-
log_debug_errno(r, "Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: %m");
694+
log_debug_errno(fd, "Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: %m");
695695
return supported = BPF_FIREWALL_UNSUPPORTED;
696696
}
697697

698698
safe_close(fd);
699699

700-
if (bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, &program) < 0) {
700+
r = bpf_program_new(BPF_PROG_TYPE_CGROUP_SKB, &program);
701+
if (r < 0) {
701702
log_debug_errno(r, "Can't allocate CGROUP SKB BPF program, BPF firewalling is not supported: %m");
702703
return supported = BPF_FIREWALL_UNSUPPORTED;
703704
}

0 commit comments

Comments
 (0)