summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-17 12:49:26 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-17 20:07:07 +0200
commit6457fb5c39fd49fab2a804241de22e0e081093f4 (patch)
tree3d800b50687f3bfbce1cd612f2b255afa3fc0505
parentd4a0aeb49a3e7536b34d101cf7b70b48cfa5f4ba (diff)
downloadsamba-6457fb5c39fd49fab2a804241de22e0e081093f4.tar.gz
s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
metze
-rw-r--r--source3/lib/util.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index b8513f6b9fa..242fb10e303 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2106,36 +2106,7 @@ bool procid_is_me(const struct server_id *pid)
struct server_id interpret_pid(const char *pid_string)
{
- struct server_id result;
- unsigned long long pid;
- unsigned int vnn, task_id = 0;
-
- ZERO_STRUCT(result);
-
- /* We accept various forms with 1, 2 or 3 component forms
- * because the server_id_str() can print different forms, and
- * we want backwards compatibility for scripts that may call
- * smbclient. */
- if (sscanf(pid_string, "%u:%llu.%u", &vnn, &pid, &task_id) == 3) {
- result.vnn = vnn;
- result.pid = pid;
- result.task_id = task_id;
- } else if (sscanf(pid_string, "%u:%llu", &vnn, &pid) == 2) {
- result.vnn = vnn;
- result.pid = pid;
- result.task_id = 0;
- } else if (sscanf(pid_string, "%llu.%u", &pid, &task_id) == 2) {
- result.vnn = get_my_vnn();
- result.pid = pid;
- result.task_id = task_id;
- } else if (sscanf(pid_string, "%llu", &pid) == 1) {
- result.vnn = get_my_vnn();
- result.pid = pid;
- } else {
- result.vnn = NONCLUSTER_VNN;
- result.pid = (uint64_t)-1;
- }
- return result;
+ return server_id_from_string(get_my_vnn(), pid_string);
}
char *procid_str_static(const struct server_id *pid)