summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2017-02-20 17:44:09 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2017-02-21 11:56:56 +0000
commit06904a8d96c8ddc9fe22d0b3e36dd5ecc0c245a7 (patch)
tree6faa1f73d74e6e9b6e4575bfedf101ec27a9eaf1 /test
parentef5d7264f15f65aefc4ea332b4744d7f94596ecc (diff)
downloaddbus-06904a8d96c8ddc9fe22d0b3e36dd5ecc0c245a7.tar.gz
tests: Consistently don't try to kill pid 0
daemon_pid will still be 0 if any tests were skipped. In particular this happens during `make installcheck`. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'test')
-rw-r--r--test/dbus-daemon-eavesdrop.c8
-rw-r--r--test/monitor.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/test/dbus-daemon-eavesdrop.c b/test/dbus-daemon-eavesdrop.c
index be51f6ab..d2c0872d 100644
--- a/test/dbus-daemon-eavesdrop.c
+++ b/test/dbus-daemon-eavesdrop.c
@@ -407,8 +407,12 @@ teardown (Fixture *f,
f->eavesdropper = NULL;
}
- test_kill_pid (f->daemon_pid);
- g_spawn_close_pid (f->daemon_pid);
+ if (f->daemon_pid != 0)
+ {
+ test_kill_pid (f->daemon_pid);
+ g_spawn_close_pid (f->daemon_pid);
+ f->daemon_pid = 0;
+ }
test_main_context_unref (f->ctx);
}
diff --git a/test/monitor.c b/test/monitor.c
index 9446294d..0402d4a8 100644
--- a/test/monitor.c
+++ b/test/monitor.c
@@ -1769,8 +1769,12 @@ teardown (Fixture *f,
f->activated = NULL;
}
- test_kill_pid (f->daemon_pid);
- g_spawn_close_pid (f->daemon_pid);
+ if (f->daemon_pid != 0)
+ {
+ test_kill_pid (f->daemon_pid);
+ g_spawn_close_pid (f->daemon_pid);
+ f->daemon_pid = 0;
+ }
test_main_context_unref (f->ctx);