log: do not use uninitialized value

Follow-up for 85cf96e3f5.
This commit is contained in:
Yu Watanabe
2021-02-09 13:58:12 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 67c972c610
commit 7bc38f59dc
+3 -1
View File
@@ -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;
}