Skip to content

Commit

Permalink
Showing 4 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@
jar 'com.github.jnr:jnr-enxio:0.16', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.36', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.37', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.8', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.1.4'
jar 'com.github.jnr:jffi:${jffi.version}'
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.36</version>
<version>3.0.37</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
15 changes: 5 additions & 10 deletions core/src/main/java/org/jruby/util/io/PopenExecutor.java
Original file line number Diff line number Diff line change
@@ -694,19 +694,14 @@ static int run_exec_pgroup(Ruby runtime, ExecArg eargp, ExecArg sargp, String[]
long pgroup;

pgroup = eargp.pgroup_pgid;
if (pgroup == -1)
pgroup = runtime.getPosix().getpgrp();

if (pgroup == 0) {
// not needed for posix_spawn
if (pgroup == -1) {
// inherit parent's process group (default behavior)
return ret;
// pgroup = runtime.getPosix().getpid(); /* async-signal-safe */
}

eargp.attributes.add(SpawnAttribute.pgroup(pgroup));
// we can't setpgid in the parent
// ret = setpgid(getpid(), pgroup); /* async-signal-safe */
// if (ret == -1) ERRMSG("setpgid");
eargp.attributes.add(SpawnAttribute.flags((short)SpawnAttribute.SETPGROUP));

return ret;
}

@@ -1336,7 +1331,7 @@ static int execargAddopt(ThreadContext context, Ruby runtime, ExecArg eargp, IRu
if (eargp.pgroup_given()) {
throw runtime.newArgumentError("pgroup option specified twice");
}
if (val == null || val.isNil())
if (val == null || !val.isTrue())
pgroup = -1; /* asis(-1) means "don't call setpgid()". */
else if (val == runtime.getTrue())
pgroup = 0; /* new process group. */
6 changes: 0 additions & 6 deletions spec/tags/ruby/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
fails:Kernel.spawn joins a new process group if pgroup: true
windows(JRUBY-4354):Kernel.spawn executes the given command
windows(JRUBY-4354):Kernel.spawn returns the process ID of the new process as a Fixnum
windows(JRUBY-4354):Kernel.spawn returns immediately
fails(compiler):Kernel.spawn does NOT redirect both STDERR and STDOUT at the time to the given name
fails:Kernel#spawn calls #to_str to convert the environment keys
fails:Kernel#spawn joins a new process group if pgroup: true
fails:Kernel#spawn joins a new process group if pgroup: 0
fails:Kernel#spawn sets the umask if given the :umask option
critical(runs very long before failing):Kernel#spawn redirects STDOUT to the given file if out: String
critical(runs very long before failing):Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
@@ -15,7 +12,6 @@ fails:Kernel#spawn raises an Errno::EACCES when passed a directory
fails:Kernel#spawn with a command array uses the first element as the command name and the second as the argv[0] value
fails:Kernel#spawn with a command array calls #to_ary to convert the argument to an Array
fails:Kernel.spawn calls #to_str to convert the environment keys
fails:Kernel.spawn joins a new process group if pgroup: 0
fails:Kernel.spawn sets the umask if given the :umask option
fails:Kernel.spawn raises an Errno::EACCES when passed a directory
fails:Kernel.spawn with a command array uses the first element as the command name and the second as the argv[0] value
@@ -24,10 +20,8 @@ fails:Kernel.spawn does NOT redirect both STDERR and STDOUT at the time to the g
critical(only in full runs):Kernel.spawn with multiple arguments does not subject the arguments to shell expansion
fails:Kernel#spawn does not unset other environment variables when given a false :unsetenv_others option
fails:Kernel#spawn does not unset environment variables included in the environment hash
fails:Kernel#spawn joins the current process if pgroup: false
fails:Kernel.spawn does not unset other environment variables when given a false :unsetenv_others option
fails:Kernel.spawn does not unset environment variables included in the environment hash
fails:Kernel.spawn joins the current process if pgroup: false
fails:Kernel#spawn redirects STDOUT to the given file if out: String
fails:Kernel#spawn redirects STDERR to the given file if err: String
fails:Kernel#spawn when passed close_others: false does not close file descriptors >= 3 in the child process if fds are set close_on_exec=false

0 comments on commit b6e06de

Please sign in to comment.