summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-07 09:35:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:52 -0500
commite6383f47629368d9dd4e803f17566a24e9d7359e (patch)
treecebde89910087c3220786f209da2c4e32a71bc46 /source3/lib/util.c
parentd1153fc79076741571b203b1d70f1536bde208f0 (diff)
downloadsamba-e6383f47629368d9dd4e803f17566a24e9d7359e.tar.gz
samba-e6383f47629368d9dd4e803f17566a24e9d7359e.tar.bz2
samba-e6383f47629368d9dd4e803f17566a24e9d7359e.zip
r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 9a22e89fe2..4425c2e1cc 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1527,7 +1527,7 @@ BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask)
Check if a process exists. Does this work on all unixes?
****************************************************************************/
-BOOL process_exists(const struct process_id pid)
+BOOL process_exists(const struct server_id pid)
{
if (procid_is_me(&pid)) {
return True;
@@ -3061,31 +3061,29 @@ uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options)
return (uint32)-1;
}
-pid_t procid_to_pid(const struct process_id *proc)
+pid_t procid_to_pid(const struct server_id *proc)
{
return proc->pid;
}
-struct process_id pid_to_procid(pid_t pid)
+struct server_id pid_to_procid(pid_t pid)
{
- struct process_id result;
+ struct server_id result;
result.pid = pid;
return result;
}
-struct process_id procid_self(void)
+struct server_id procid_self(void)
{
return pid_to_procid(sys_getpid());
}
struct server_id server_id_self(void)
{
- struct server_id id;
- id.id = procid_self();
- return id;
+ return procid_self();
}
-BOOL procid_equal(const struct process_id *p1, const struct process_id *p2)
+BOOL procid_equal(const struct server_id *p1, const struct server_id *p2)
{
return (p1->pid == p2->pid);
}
@@ -3093,37 +3091,37 @@ BOOL procid_equal(const struct process_id *p1, const struct process_id *p2)
BOOL cluster_id_equal(const struct server_id *id1,
const struct server_id *id2)
{
- return procid_equal(&id1->id, &id2->id);
+ return procid_equal(id1, id2);
}
-BOOL procid_is_me(const struct process_id *pid)
+BOOL procid_is_me(const struct server_id *pid)
{
return (pid->pid == sys_getpid());
}
-struct process_id interpret_pid(const char *pid_string)
+struct server_id interpret_pid(const char *pid_string)
{
return pid_to_procid(atoi(pid_string));
}
-char *procid_str_static(const struct process_id *pid)
+char *procid_str_static(const struct server_id *pid)
{
static fstring str;
fstr_sprintf(str, "%d", pid->pid);
return str;
}
-char *procid_str(TALLOC_CTX *mem_ctx, const struct process_id *pid)
+char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid)
{
return talloc_strdup(mem_ctx, procid_str_static(pid));
}
-BOOL procid_valid(const struct process_id *pid)
+BOOL procid_valid(const struct server_id *pid)
{
return (pid->pid != -1);
}
-BOOL procid_is_local(const struct process_id *pid)
+BOOL procid_is_local(const struct server_id *pid)
{
return True;
}