summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-22 12:36:22 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-24 13:43:31 +0200
commit0b5e354080ae1990b1f8acc470bfbad3f92868b8 (patch)
tree67ce89eeff1aeb36b09085409efd5e8a00db5b39
parent774c28416bd05c66f398dfbc999cff0e209b3620 (diff)
downloadsamba-0b5e354080ae1990b1f8acc470bfbad3f92868b8.tar.gz
samba-0b5e354080ae1990b1f8acc470bfbad3f92868b8.tar.bz2
samba-0b5e354080ae1990b1f8acc470bfbad3f92868b8.zip
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
-rw-r--r--source3/lib/util.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 242fb10e30..5ca2a7f931 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -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,