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/update-utmp/update-utmp.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/update-utmp/update-utmp.c')
-rw-r--r-- | src/update-utmp/update-utmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c index ae9859ccad..f68d60a134 100644 --- a/src/update-utmp/update-utmp.c +++ b/src/update-utmp/update-utmp.c @@ -33,6 +33,7 @@ #include "format-util.h" #include "log.h" #include "macro.h" +#include "process-util.h" #include "special.h" #include "strv.h" #include "unit-name.h" @@ -258,7 +259,7 @@ int main(int argc, char *argv[]) { goto finish; } - log_debug("systemd-update-utmp running as pid "PID_FMT, getpid()); + log_debug("systemd-update-utmp running as pid "PID_FMT, getpid_cached()); if (streq(argv[1], "reboot")) r = on_reboot(&c); @@ -271,7 +272,7 @@ int main(int argc, char *argv[]) { r = -EINVAL; } - log_debug("systemd-update-utmp stopped as pid "PID_FMT, getpid()); + log_debug("systemd-update-utmp stopped as pid "PID_FMT, getpid_cached()); finish: #ifdef HAVE_AUDIT |