ask-password: use kill(PID, 0) before querying a password

This commit is contained in:
Lennart Poettering 2011-04-13 21:43:36 +02:00
parent 7dcda352a6
commit ded8033531

View File

@ -291,6 +291,13 @@ static int parse_password(const char *filename, char **wall) {
}
}
if (pid > 0 &&
kill(pid, 0) < 0 &&
errno == ESRCH) {
r = 0;
goto finish;
}
if (arg_action == ACTION_LIST)
printf("'%s' (PID %u)\n", message, pid);
else if (arg_action == ACTION_WALL) {