From 37d7d523589cfa69220b60a37abbb5aefb11f338 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Oct 2011 13:36:56 +0200 Subject: s3: Add serverids_exist --- source3/include/serverid.h | 5 +++++ source3/lib/serverid.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/source3/include/serverid.h b/source3/include/serverid.h index 62bf638214..babb21b8f7 100644 --- a/source3/include/serverid.h +++ b/source3/include/serverid.h @@ -43,6 +43,11 @@ bool serverid_register_msg_flags(const struct server_id id, bool do_reg, */ bool serverid_exists(const struct server_id *id); +/* + * Check existence of a list of server ids + */ +bool serverids_exist(const struct server_id *ids, int num_ids, bool *results); + /* * Walk the list of server_ids registered */ diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index b3b294f893..274b44b86f 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -273,6 +273,40 @@ bool serverid_exists(const struct server_id *id) return state.exists; } +bool serverids_exist(const struct server_id *ids, int num_ids, bool *results) +{ + struct db_context *db; + int i; + + if (!processes_exist(ids, num_ids, results)) { + return false; + } + + db = serverid_db(); + if (db == NULL) { + return false; + } + + for (i=0; i