s3:lib: implement process_exists() as wrapper of serverid_exists()
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Aug 2012 10:36:22 +0000 (12:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 24 Aug 2012 11:43:31 +0000 (13:43 +0200)
The changes the behavior of process_exists() it checks the pid.unique_id
now, if it's not SERVERID_UNIQUE_ID_NOT_TO_VERIFY.

metze

source3/lib/util.c

index 242fb10e303448f9b8335dff0ad11884e93e4f4a..5ca2a7f93133cedd29fac93a625ecd2f8f5172dc 100644 (file)
@@ -30,6 +30,7 @@
 #include "messages.h"
 #include <ccan/hash/hash.h>
 #include "libcli/security/security.h"
+#include "serverid.h"
 
 #ifdef HAVE_SYS_PRCTL_H
 #include <sys/prctl.h>
@@ -712,20 +713,7 @@ char *automount_lookup(TALLOC_CTX *ctx, const char *user_name)
 
 bool process_exists(const struct server_id pid)
 {
-       if (procid_is_me(&pid)) {
-               return True;
-       }
-
-       if (procid_is_local(&pid)) {
-               return (kill(pid.pid,0) == 0 || errno != ESRCH);
-       }
-
-#ifdef CLUSTER_SUPPORT
-       return ctdbd_process_exists(messaging_ctdbd_connection(),
-                                   pid.vnn, pid.pid);
-#else
-       return False;
-#endif
+       return serverid_exists(&pid);
 }
 
 bool processes_exist(const struct server_id *pids, int num_pids,