chiark / gitweb /
util: generalize code that checks whether PIDs are alive or unwaited for
[elogind.git] / src / tty-ask-password-agent / tty-ask-password-agent.c
index c0451c0fd0fabf3daf8faf73a4e7acd1b6b9303d..08177c6d04f080bb02e76cfe966183fe118b55ea 100644 (file)
@@ -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;
         }