summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent/tty-ask-password-agent.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-17 18:28:53 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-18 02:51:47 +0100
commit9f5650aecb22a1d864b2c0b749910556795f1490 (patch)
tree62283b6837299eff161d62438372ec6d54d6b451 /src/tty-ask-password-agent/tty-ask-password-agent.c
parented7e5fe37d7e3392538844abadbb2903f4d2540f (diff)
util: generalize code that checks whether PIDs are alive or unwaited for
Diffstat (limited to 'src/tty-ask-password-agent/tty-ask-password-agent.c')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index c0451c0fd0..08177c6d04 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -294,9 +294,7 @@ static int parse_password(const char *filename, char **wall) {
}
}
- if (pid > 0 &&
- kill(pid, 0) < 0 &&
- errno == ESRCH) {
+ if (pid > 0 && !pid_is_alive(pid)) {
r = 0;
goto finish;
}