diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-08 14:05:55 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:09 +0200 |
commit | 16b1c77644217796f70a3a0bf1d95c245f9ee2d9 (patch) | |
tree | b08d316880e1a03d1a7fad4c5ced8d141878986c /source3/lib | |
parent | d01dbd6c3fd9ca2595d65991b56db4400a35ece0 (diff) | |
download | samba-16b1c77644217796f70a3a0bf1d95c245f9ee2d9.tar.gz samba-16b1c77644217796f70a3a0bf1d95c245f9ee2d9.tar.bz2 samba-16b1c77644217796f70a3a0bf1d95c245f9ee2d9.zip |
lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.
Andrew Bartlett
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/g_lock.c | 10 | ||||
-rw-r--r-- | source3/lib/util.c | 18 |
2 files changed, 6 insertions, 22 deletions
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index f2452919af..006ee3698c 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -108,7 +108,7 @@ static bool g_lock_parse(TALLOC_CTX *mem_ctx, TDB_DATA data, DEBUG(10, ("locks:\n")); for (i=0; i<num_locks; i++) { DEBUGADD(10, ("%s: %s %s\n", - procid_str(talloc_tos(), &locks[i].pid), + server_id_str(talloc_tos(), &locks[i].pid), ((locks[i].lock_type & 1) == G_LOCK_READ) ? "read" : "write", (locks[i].lock_type & G_LOCK_PENDING) ? @@ -118,7 +118,7 @@ static bool g_lock_parse(TALLOC_CTX *mem_ctx, TDB_DATA data, && !process_exists(locks[i].pid)) { DEBUGADD(10, ("lock owner %s died -- discarding\n", - procid_str(talloc_tos(), + server_id_str(talloc_tos(), &locks[i].pid))); if (i < (num_locks-1)) { @@ -146,7 +146,7 @@ static void g_lock_cleanup(int *pnum_locks, struct g_lock_rec *locks) continue; } DEBUGADD(10, ("%s does not exist -- discarding\n", - procid_str(talloc_tos(), &locks[i].pid))); + server_id_str(talloc_tos(), &locks[i].pid))); if (i < (num_locks-1)) { locks[i] = locks[num_locks-1]; @@ -496,7 +496,7 @@ static void g_lock_got_retry(struct messaging_context *msg, bool *pretry = (bool *)private_data; DEBUG(10, ("Got retry message from pid %s\n", - procid_str(talloc_tos(), &server_id))); + server_id_str(talloc_tos(), &server_id))); *pretry = true; } @@ -587,7 +587,7 @@ static NTSTATUS g_lock_force_unlock(struct g_lock_ctx *ctx, const char *name, &data_blob_null); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("sending retry to %s failed: %s\n", - procid_str(talloc_tos(), + server_id_str(talloc_tos(), &locks[i].pid), nt_errstr(status))); } else { diff --git a/source3/lib/util.c b/source3/lib/util.c index ca30858914..5fb8a41dae 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1987,25 +1987,9 @@ struct server_id interpret_pid(const char *pid_string) return result; } -char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid) -{ - if (pid->vnn == NONCLUSTER_VNN && pid->task_id == 0) { - return talloc_asprintf(mem_ctx, - "%llu", - (unsigned long long)pid->pid); - } - else { - return talloc_asprintf(mem_ctx, - "%u:%llu:%u", - (unsigned)pid->vnn, - (unsigned long long)pid->pid, - (unsigned)pid->task_id); - } -} - char *procid_str_static(const struct server_id *pid) { - return procid_str(talloc_tos(), pid); + return server_id_str(talloc_tos(), pid); } bool procid_valid(const struct server_id *pid) |