aboutsummaryrefslogtreecommitdiff
path: root/src/gui_backend_local.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-08-12 11:35:36 +0200
committerThomas White <taw@physics.org>2020-08-12 11:35:57 +0200
commited8a379c85b67ece4c4918d3f324a95f1f20cb4a (patch)
tree9bcc86fa479007a6b7ad0a14a33ad3ce50107d2e /src/gui_backend_local.c
parentd8d3d2df980ca7742f4fe162d67693db9f4dbf24 (diff)
GUI: Set pgid before exec
See 870e4e5740. This is a better way of doing the same thing.
Diffstat (limited to 'src/gui_backend_local.c')
-rw-r--r--src/gui_backend_local.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index ca1ffc73..e485ed35 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -132,6 +132,13 @@ static void add_arg(char **args, int pos, const char *label,
}
+void setup_subprocess(gpointer user_data)
+{
+ setsid();
+ setpgid(0, 0);
+}
+
+
static int run_unitcell(struct crystfelproject *proj,
const char *algo)
{
@@ -212,7 +219,7 @@ static int run_unitcell(struct crystfelproject *proj,
r = g_spawn_async_with_pipes(NULL, args, NULL,
G_SPAWN_SEARCH_PATH
| G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL,
+ setup_subprocess, NULL,
&priv->indexamajig_pid,
NULL, NULL, &ch_stderr,
&error);