mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
lib: Add "pid/unique" format for server_id_from_string
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
a4f64500a5
commit
2c12b516a9
@ -103,6 +103,14 @@ struct server_id server_id_from_string(uint32_t local_vnn,
|
||||
* smbclient.
|
||||
*/
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu32":%"SCNu64".%"SCNu32"/%"SCNu64,
|
||||
&result.vnn, &result.pid, &result.task_id,
|
||||
&result.unique_id);
|
||||
if (ret == 4) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu32":%"SCNu64".%"SCNu32,
|
||||
&result.vnn, &result.pid, &result.task_id);
|
||||
@ -110,6 +118,13 @@ struct server_id server_id_from_string(uint32_t local_vnn,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu32":%"SCNu64"/%"SCNu64,
|
||||
&result.vnn, &result.pid, &result.unique_id);
|
||||
if (ret == 3) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu32":%"SCNu64,
|
||||
&result.vnn, &result.pid);
|
||||
@ -117,6 +132,14 @@ struct server_id server_id_from_string(uint32_t local_vnn,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu64".%"SCNu32"/%"SCNu64,
|
||||
&result.pid, &result.task_id, &result.unique_id);
|
||||
if (ret == 3) {
|
||||
result.vnn = local_vnn;
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu64".%"SCNu32,
|
||||
&result.pid, &result.task_id);
|
||||
@ -125,6 +148,14 @@ struct server_id server_id_from_string(uint32_t local_vnn,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu64"/%"SCNu64,
|
||||
&result.pid, &result.unique_id);
|
||||
if (ret == 2) {
|
||||
result.vnn = local_vnn;
|
||||
return result;
|
||||
}
|
||||
|
||||
result = templ;
|
||||
ret = sscanf(pid_string, "%"SCNu64, &result.pid);
|
||||
if (ret == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user