summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/actions.c b/src/actions.c
index 24cb62f..79db068 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -2646,13 +2646,17 @@ spawn(char *cmd, int raw, rp_frame *frame)
in its own session. */
putenv(current_screen()->display_string);
#ifdef HAVE_SETSID
- setsid();
+ if (setsid() == -1)
#endif
+ {
#if defined (HAVE_SETPGID)
- setpgid (0, 0);
+ setpgid (0, 0);
#elif defined (HAVE_SETPGRP)
- setpgrp (0, 0);
+ /* Assume BSD-style setpgrp */
+ setpgrp (0, 0);
#endif
+ }
+
/* raw means don't run it through sh. */
if (raw)
execl (cmd, cmd, NULL);