diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-08-22 13:30:22 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-08-24 13:43:34 +0200 |
commit | 1f7eac907a04361abf89b12ab03284cf57fec0f5 (patch) | |
tree | 49831ca9ffe28585266f3277c3e95715e37dac0d | |
parent | 9529301503c043aaf8d3c39d3b0f014aaa0cc123 (diff) | |
download | samba-1f7eac907a04361abf89b12ab03284cf57fec0f5.tar.gz samba-1f7eac907a04361abf89b12ab03284cf57fec0f5.tar.bz2 samba-1f7eac907a04361abf89b12ab03284cf57fec0f5.zip |
s3:lib: remove unused processes_exist()
metze
-rw-r--r-- | source3/lib/util.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 5ca2a7f931..5ffce583db 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -707,81 +707,11 @@ char *automount_lookup(TALLOC_CTX *ctx, const char *user_name) #endif /* WITH_NISPLUS_HOME */ #endif -/**************************************************************************** - Check if a process exists. Does this work on all unixes? -****************************************************************************/ - bool process_exists(const struct server_id pid) { return serverid_exists(&pid); } -bool processes_exist(const struct server_id *pids, int num_pids, - bool *results) -{ - struct server_id *remote_pids = NULL; - int *remote_idx = NULL; - bool *remote_results = NULL; - int i, num_remote_pids; - bool result = false; - - remote_pids = talloc_array(talloc_tos(), struct server_id, num_pids); - if (remote_pids == NULL) { - goto fail; - } - remote_idx = talloc_array(talloc_tos(), int, num_pids); - if (remote_idx == NULL) { - goto fail; - } - remote_results = talloc_array(talloc_tos(), bool, num_pids); - if (remote_results == NULL) { - goto fail; - } - - num_remote_pids = 0; - - for (i=0; i<num_pids; i++) { - if (procid_is_me(&pids[i])) { - results[i] = true; - continue; - } - if (procid_is_local(&pids[i])) { - results[i] = ((kill(pids[i].pid,0) == 0) || - (errno != ESRCH)); - continue; - } - - remote_pids[num_remote_pids] = pids[i]; - remote_idx[num_remote_pids] = i; - num_remote_pids += 1; - } - - if (num_remote_pids != 0) { -#ifdef CLUSTER_SUPPORT - if (!ctdb_processes_exist(messaging_ctdbd_connection(), - remote_pids, num_remote_pids, - remote_results)) { - goto fail; - } -#else - for (i=0; i<num_remote_pids; i++) { - remote_results[i] = false; - } -#endif - - for (i=0; i<num_remote_pids; i++) { - results[remote_idx[i]] = remote_results[i]; - } - } - - result = true; -fail: - TALLOC_FREE(remote_results); - TALLOC_FREE(remote_idx); - TALLOC_FREE(remote_pids); - return result; -} - /******************************************************************* Convert a uid into a user name. ********************************************************************/ |