From 9f5650aecb22a1d864b2c0b749910556795f1490 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 17 Feb 2014 18:28:53 +0100 Subject: util: generalize code that checks whether PIDs are alive or unwaited for --- src/tty-ask-password-agent/tty-ask-password-agent.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/tty-ask-password-agent') 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; } -- cgit v1.2.3-54-g00ecf