diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 11:18:15 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:09 +0200 |
commit | daf79e33c7e8873345fb4a251f1e880fd767df19 (patch) | |
tree | ad97087a857d7db7f7478d6057faabd830136152 /lib/util | |
parent | f348d148b463ca61cbc48d2aadeaa099f7150425 (diff) | |
download | samba-daf79e33c7e8873345fb4a251f1e880fd767df19.tar.gz samba-daf79e33c7e8873345fb4a251f1e880fd767df19.tar.bz2 samba-daf79e33c7e8873345fb4a251f1e880fd767df19.zip |
server_id: Change format to vnn:pid.task_id, pid.task_id or pid
This helps ensure the string cannot be ambiguous, while also ensuring
that it remains simple in the non-cluster case.
The asymmetry of reading get_my_vnn() but writing based on
NONCLUSTER_VNN is acceptable because in the non-clustered case, they
are equal, and in the clustered case we will print the full string.
Andrew Bartlett
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/server_id.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util/server_id.c b/lib/util/server_id.c index a67c40eb19..195deeac7c 100644 --- a/lib/util/server_id.c +++ b/lib/util/server_id.c @@ -26,9 +26,14 @@ char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id) return talloc_asprintf(mem_ctx, "%llu", (unsigned long long)id->pid); + } else if (id->vnn == NONCLUSTER_VNN) { + return talloc_asprintf(mem_ctx, + "%llu.%u", + (unsigned long long)id->pid, + (unsigned)id->task_id); } else { return talloc_asprintf(mem_ctx, - "%u:%llu:%u", + "%u:%llu.%u", (unsigned)id->vnn, (unsigned long long)id->pid, (unsigned)id->task_id); |