summaryrefslogtreecommitdiff
path: root/desktop/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-30 14:28:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-01 16:21:54 +0200
commitd35840a2111beafe018851314a624e268e3cde6a (patch)
treeee7996e4a194314d1be839c10884d2c76076eeb4 /desktop/unx
parent11a1e514db79b7109c3ad59be4a27f724aadc1de (diff)
uitest: make child soffice process die when parent dies
using PR_SET_PDEATHSIG. Note that this can only be called by the child process in question, so we have to pass a new command line argument down to activate it. And we have to plumb it through the wrapper oosplash process. I wonder where else our testing infrastructure could benefit from this Change-Id: I55e8e9f7f4e6cc415046df04c804e51475b8a4c9 Reviewed-on: https://gerrit.libreoffice.org/79854 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/unx')
-rw-r--r--desktop/unx/source/args.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c
index 199b58a8e50e..81a8dbca4bb5 100644
--- a/desktop/unx/source/args.c
+++ b/desktop/unx/source/args.c
@@ -9,6 +9,10 @@
#include <stdlib.h>
#include <string.h>
#include <osl/process.h>
+#ifdef LINUX
+#include <sys/prctl.h>
+#include <signal.h>
+#endif
#include "args.h"
@@ -121,6 +125,15 @@ Args *args_parse (void)
args->pPageinType = pArgDescr[j].pPageinType;
break;
}
+ if (rtl_ustr_ascii_compare_WithLength(
+ arg, length, "dont-survive-parent")
+ == 0)
+ {
+#ifdef LINUX
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+#endif
+ break;
+ }
}
}