diff options
author | Thomas White <taw@physics.org> | 2020-08-12 11:35:36 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-08-12 11:35:57 +0200 |
commit | ed8a379c85b67ece4c4918d3f324a95f1f20cb4a (patch) | |
tree | 9bcc86fa479007a6b7ad0a14a33ad3ce50107d2e | |
parent | d8d3d2df980ca7742f4fe162d67693db9f4dbf24 (diff) |
GUI: Set pgid before exec
See 870e4e5740. This is a better way of doing the same thing.
-rw-r--r-- | src/gui_backend_local.c | 9 |
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); |