summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c
index 41d0149..8468f16 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -864,9 +864,14 @@ spawn(void *data)
/* Some process setup to make sure the spawned process runs
in its own session. */
putenv(DisplayString(dpy));
+#ifdef HAVE_SETSID
setsid();
+#endif
+#if defined (HAVE_SETPGID)
setpgid (0, 0);
-
+#elif defined (HAVE_SETPGRP)
+ setpgrp (0, 0);
+#endif
execl("/bin/sh", "sh", "-c", cmd, 0);
_exit(EXIT_FAILURE);
}