diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-09 19:07:35 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-09 13:58:12 +0100 |
commit | 7bc38f59dc6c54fcabc5f44ecb20ab43dda0838d (patch) | |
tree | d5ed8cf17de6b9485f702eec2e2d4d9765e625e4 /src/basic/log.c | |
parent | 67c972c610de61789d1b6560d28340f70d4b1196 (diff) | |
download | systemd-7bc38f59dc6c54fcabc5f44ecb20ab43dda0838d.tar.gz |
log: do not use uninitialized value
Follow-up for 85cf96e3f567cd51f79d671bbf3559550fdd67b7.
Diffstat (limited to 'src/basic/log.c')
-rw-r--r-- | src/basic/log.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index 6a86fab398..ff501af569 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1175,9 +1175,11 @@ static bool should_parse_proc_cmdline(void) { /* For testing. */ return true; - if (parse_pid(e, &p) < 0) + if (parse_pid(e, &p) < 0) { /* We know that systemd sets the variable correctly. Something else must have set it. */ log_debug("Failed to parse \"$SYSTEMD_EXEC_PID=%s\". Ignoring.", e); + return false; + } return getpid_cached() == p; } |