1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

core: check for return value from get_process_state

Fix for commit e10c9985bb.
This commit is contained in:
Yuxuan Shui 2014-02-15 13:20:55 +08:00 committed by Zbigniew Jędrzejewski-Szmek
parent 5d31974e44
commit e3025da104

View File

@ -1376,7 +1376,13 @@ static int service_load_pid_file(Service *s, bool may_warn) {
return -ESRCH;
}
if (get_process_state(pid) == 'Z') {
r = get_process_state(pid);
if (r < 0) {
if (may_warn)
log_info_unit(UNIT(s)->id, "Failed to read /proc/%d/stat: %s",
pid, strerror(-r));
return r;
} else if (r == 'Z') {
if (may_warn)
log_info_unit(UNIT(s)->id,
"PID "PID_FMT" read from file %s is a zombie.",