From ba0171f72402d823abc86504c35312a29749f9b2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Oct 2011 12:18:21 +0200 Subject: s3: Add processes_exist --- source3/lib/util.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index f547ec2a56..9b9d34c22f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -657,6 +657,72 @@ bool process_exists(const struct server_id pid) #endif } +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