chiark / gitweb /
util: generalize code that checks whether PIDs are alive or unwaited for
[elogind.git] / src / libsystemd / sd-bus / bus-creds.c
index 677e94b3ba88c8a93cd9d057c6913096863c2846..6143254a60761ad44e7cfd52a1fb1b91d4137af0 100644 (file)
@@ -148,7 +148,7 @@ _public_ int sd_bus_creds_new_from_pid(pid_t pid, uint64_t mask, sd_bus_creds **
 
         /* Check if the process existed at all, in case we haven't
          * figured that out already */
-        if (kill(pid, 0) < 0 && errno == ESRCH) {
+        if (!pid_is_alive(pid)) {
                 sd_bus_creds_unref(c);
                 return -ESRCH;
         }