mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
lib: Introduce server_id_same_process()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
1c4284c739
commit
46e912210d
@ -985,6 +985,8 @@ struct server_id;
|
||||
struct server_id_buf { char buf[48]; }; /* probably a bit too large ... */
|
||||
char *server_id_str_buf(struct server_id id, struct server_id_buf *dst);
|
||||
|
||||
bool server_id_same_process(const struct server_id *p1,
|
||||
const struct server_id *p2);
|
||||
bool server_id_equal(const struct server_id *p1, const struct server_id *p2);
|
||||
char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id);
|
||||
struct server_id server_id_from_string(uint32_t local_vnn,
|
||||
|
@ -20,9 +20,15 @@
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/server_id.h"
|
||||
|
||||
bool server_id_same_process(const struct server_id *p1,
|
||||
const struct server_id *p2)
|
||||
{
|
||||
return ((p1->pid == p2->pid) && (p1->vnn == p2->vnn));
|
||||
}
|
||||
|
||||
bool server_id_equal(const struct server_id *p1, const struct server_id *p2)
|
||||
{
|
||||
if (p1->pid != p2->pid) {
|
||||
if (!server_id_same_process(p1, p2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -30,10 +36,6 @@ bool server_id_equal(const struct server_id *p1, const struct server_id *p2)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p1->vnn != p2->vnn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p1->unique_id != p2->unique_id) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user