diff options
author | Simon McVittie <smcv@debian.org> | 2016-11-29 00:48:14 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-11-29 12:32:40 +0000 |
commit | ca2cdab866ad6ef94a477bde6497dbf8deb3aeef (patch) | |
tree | 5f76f2258892273a18f999a3a2655740a1c0f9b6 /test/sd-activation.c | |
parent | 6dd92fd8251d1c56ad1747962604f48017e8ea9f (diff) | |
download | dbus-ca2cdab866ad6ef94a477bde6497dbf8deb3aeef.tar.gz |
activation test: don't crash if AppArmor is built but unavailable
Also don't try to clean up a process we didn't start.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Diffstat (limited to 'test/sd-activation.c')
-rw-r--r-- | test/sd-activation.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/sd-activation.c b/test/sd-activation.c index 058a2472..da63f7d4 100644 --- a/test/sd-activation.c +++ b/test/sd-activation.c @@ -801,9 +801,15 @@ teardown (Fixture *f, f->activated = NULL; } - test_kill_pid (f->daemon_pid); - g_spawn_close_pid (f->daemon_pid); - test_main_context_unref (f->ctx); + if (f->daemon_pid != 0) + { + test_kill_pid (f->daemon_pid); + g_spawn_close_pid (f->daemon_pid); + } + + if (f->ctx != NULL) + test_main_context_unref (f->ctx); + g_free (f->address); } |