summaryrefslogtreecommitdiff
path: root/desktop/source
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/source
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/source')
-rw-r--r--desktop/source/app/cmdlineargs.cxx14
-rw-r--r--desktop/source/app/cmdlinehelp.cxx3
2 files changed, 16 insertions, 1 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 381147cd534e..46395ae87133 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -42,6 +42,11 @@
#include <osl/file.hxx>
#include <sal/log.hxx>
+#ifdef LINUX
+#include <sys/prctl.h>
+#include <signal.h>
+#endif
+
using namespace com::sun::star::lang;
using namespace com::sun::star::uri;
using namespace com::sun::star::uno;
@@ -362,6 +367,15 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{
// Do nothing, accept only for backward compatibility
}
+ else if ( oArg == "dont-survive-parent" )
+ {
+// only supported on linux for now
+#ifdef LINUX
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+#else
+ fprintf(stderr, "Warning: dont-survive-parent is not supported on this platform (yet).\n");
+#endif
+ }
else if ( oArg == "nologo" )
{
m_nologo = true;
diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx
index bdb04bb9d4d8..b6afe63fe57a 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -112,7 +112,8 @@ namespace desktop
"Developer arguments: \n"
" --terminate_after_init \n"
" Exit after initialization complete (no documents loaded)\n"
- " --eventtesting Exit after loading documents. \n\n"
+ " --eventtesting Exit after loading documents. \n"
+ " --dont-survive-parent Exit when the parent exits (linux only) \n\n"
"New document creation arguments: \n"
"The arguments create an empty document of specified kind. Only one of them may \n"
"be used in one command line. If filenames are specified after an argument, \n"