summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/process.c b/process.c
index 682ba259bc..ae877c1147 100644
--- a/process.c
+++ b/process.c
@@ -2015,11 +2015,12 @@ run_exec_pgroup(VALUE obj, VALUE save)
* No race condition, even without setpgid from the parent.
* (Is there an environment which has setpgid but FD_CLOEXEC?)
*/
+ pid_t pgroup;
if (!NIL_P(save)) {
/* maybe meaningless with no fork environment... */
rb_ary_store(save, EXEC_OPTION_PGROUP, PIDT2NUM(getpgrp()));
}
- pid_t pgroup = NUM2PIDT(obj);
+ pgroup = NUM2PIDT(obj);
if (pgroup == 0) {
pgroup = getpid();
}