From: Stefan Metzmacher Date: Wed, 22 Aug 2012 10:36:22 +0000 (+0200) Subject: s3:lib: implement process_exists() as wrapper of serverid_exists() X-Git-Tag: samba-4.0.0beta7~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b5e354080ae1990b1f8acc470bfbad3f92868b8;p=thirdparty%2Fsamba.git s3:lib: implement process_exists() as wrapper of serverid_exists() 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 --- diff --git a/source3/lib/util.c b/source3/lib/util.c index 242fb10e303..5ca2a7f9313 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -30,6 +30,7 @@ #include "messages.h" #include #include "libcli/security/security.h" +#include "serverid.h" #ifdef HAVE_SYS_PRCTL_H #include @@ -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,