mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-27 14:15:34 +07:00
ask-password: use kill(PID, 0) before querying a password
This commit is contained in:
parent
7dcda352a6
commit
ded8033531
@ -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)
|
if (arg_action == ACTION_LIST)
|
||||||
printf("'%s' (PID %u)\n", message, pid);
|
printf("'%s' (PID %u)\n", message, pid);
|
||||||
else if (arg_action == ACTION_WALL) {
|
else if (arg_action == ACTION_WALL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user