summaryrefslogtreecommitdiffstats
path: root/src/test/test-signal-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-07-20 16:19:18 +0200
committerLennart Poettering <lennart@poettering.net>2017-07-20 20:27:24 +0200
commitdf0ff127758809a45105893772de76082d12a26d (patch)
tree9deb3a960cf26b54beae6a0b60d376c6ba8efe9a /src/test/test-signal-util.c
parentprocess-util: add getpid_cached() as a caching wrapper for getpid() (diff)
downloadsystemd-df0ff127758809a45105893772de76082d12a26d.tar.xz
systemd-df0ff127758809a45105893772de76082d12a26d.zip
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/test/test-signal-util.c')
-rw-r--r--src/test/test-signal-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c
index 671eb869cb..92e3927784 100644
--- a/src/test/test-signal-util.c
+++ b/src/test/test-signal-util.c
@@ -50,12 +50,12 @@ static void test_block_signals(void) {
static void test_ignore_signals(void) {
assert_se(ignore_signals(SIGINT, -1) >= 0);
- assert_se(kill(getpid(), SIGINT) >= 0);
+ assert_se(kill(getpid_cached(), SIGINT) >= 0);
assert_se(ignore_signals(SIGUSR1, SIGUSR2, SIGTERM, SIGPIPE, -1) >= 0);
- assert_se(kill(getpid(), SIGUSR1) >= 0);
- assert_se(kill(getpid(), SIGUSR2) >= 0);
- assert_se(kill(getpid(), SIGTERM) >= 0);
- assert_se(kill(getpid(), SIGPIPE) >= 0);
+ assert_se(kill(getpid_cached(), SIGUSR1) >= 0);
+ assert_se(kill(getpid_cached(), SIGUSR2) >= 0);
+ assert_se(kill(getpid_cached(), SIGTERM) >= 0);
+ assert_se(kill(getpid_cached(), SIGPIPE) >= 0);
assert_se(default_signals(SIGINT, SIGUSR1, SIGUSR2, SIGTERM, SIGPIPE, -1) >= 0);
}