chiark / gitweb /
util: generalize code that checks whether PIDs are alive or unwaited for
[elogind.git] / src / core / unit.c
index d529638f86a300b75a7f10a552efb6b9a24dfcea..21ad434f9d7d88af50bd0a13d58e6693df721f72 100644 (file)
@@ -1833,7 +1833,7 @@ void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2) {
                 if (pid == except1 || pid == except2)
                         continue;
 
-                if (kill(pid, 0) < 0 && errno == ESRCH)
+                if (!pid_is_unwaited(pid))
                         set_remove(u->pids, e);
         }
 }