diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-07-25 14:29:35 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-07-25 17:34:33 +0000 |
commit | 94e130fb866d4b7bdbeacb4152093d827d5eb2bb (patch) | |
tree | e977f6630c2db0e472a596cc4a459c1cb51aa7c0 /source3/lib/messages_ctdb_ref.c | |
parent | bcfb257bbf99a6b709dacdf22da6a0e190742a90 (diff) | |
download | samba-94e130fb866d4b7bdbeacb4152093d827d5eb2bb.tar.gz |
s3:lib/messages*: s/getpid/tevent_cached_getpid
Our messaging code is very performance critical and
we should note waste time in getpid() syscalls...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/messages_ctdb_ref.c')
-rw-r--r-- | source3/lib/messages_ctdb_ref.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/messages_ctdb_ref.c b/source3/lib/messages_ctdb_ref.c index 3570ed8ae4c..ed6285f2e36 100644 --- a/source3/lib/messages_ctdb_ref.c +++ b/source3/lib/messages_ctdb_ref.c @@ -61,7 +61,7 @@ void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev, tmp_refs = refs; - if ((refs != NULL) && (ctdb_pid != getpid())) { + if ((refs != NULL) && (ctdb_pid != tevent_cached_getpid())) { /* * Have to reinit after fork */ @@ -82,7 +82,7 @@ void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev, *err = ret; return NULL; } - ctdb_pid = getpid(); + ctdb_pid = tevent_cached_getpid(); } result->fde = messaging_ctdb_register_tevent_context(result, ev); |