diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-07-20 16:19:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-07-20 20:27:24 +0200 |
commit | df0ff127758809a45105893772de76082d12a26d (patch) | |
tree | 9deb3a960cf26b54beae6a0b60d376c6ba8efe9a /src/basic/fd-util.c | |
parent | 5c30a6d2b805ae9b5dd0ad003b9ee86b8965bc47 (diff) | |
download | systemd-df0ff127758809a45105893772de76082d12a26d.tar.gz |
tree-wide: make use of getpid_cached() wherever we can
This moves pretty much all uses of getpid() over to getpid_raw(). I
didn't specifically check whether the optimization is worth it for each
replacement, but in order to keep things simple and systematic I
switched over everything at once.
Diffstat (limited to 'src/basic/fd-util.c')
-rw-r--r-- | src/basic/fd-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index 19ad20789b..9d61044c89 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -31,6 +31,7 @@ #include "missing.h" #include "parse-util.h" #include "path-util.h" +#include "process-util.h" #include "socket-util.h" #include "stdio-util.h" #include "util.h" @@ -282,7 +283,7 @@ int same_fd(int a, int b) { return true; /* Try to use kcmp() if we have it. */ - pid = getpid(); + pid = getpid_cached(); r = kcmp(pid, pid, KCMP_FILE, a, b); if (r == 0) return true; |