Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 106ad0f49f7b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d35948345263
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 9, 2017

  1. Check pseudo-errno for error rather than real errno. Fixes #4527.

    The tty change in bfb5eeb triggered this but was only exposing
    a bug in our process logic wherein we raised an error based on the
    real errno rather than the fake errno in PopenExecutor.
    headius committed Mar 9, 2017
    Copy the full SHA
    bafb4f5 View commit details
  2. Copy the full SHA
    d359483 View commit details
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/util/io/OpenFile.java
Original file line number Diff line number Diff line change
@@ -2415,6 +2415,9 @@ public void checkTTY() {
if (locked) unlock();
}
}

// Clear errno so ENOTTY does not get picked up elsewhere (jruby/jruby#4527
runtime.getPosix().errno(0);
}

public boolean isBOM() {
5 changes: 4 additions & 1 deletion core/src/main/java/org/jruby/util/io/PopenExecutor.java
Original file line number Diff line number Diff line change
@@ -130,7 +130,9 @@ long spawnProcess(ThreadContext context, Ruby runtime, ExecArg eargp, String[] e
}
if (pid == -1) {
context.setLastExitStatus(new RubyProcess.RubyStatus(runtime, runtime.getProcStatus(), 0x7f << 8, 0));
errno = Errno.valueOf(runtime.getPosix().errno());
if (errno == null || errno == Errno.__UNKNOWN_CONSTANT__) {
errno = Errno.valueOf(runtime.getPosix().errno());
}
}

execargRunOptions(context, runtime, sarg, null, errmsg);
@@ -163,6 +165,7 @@ long procSpawnCmdInternal(Ruby runtime, String[] argv, String prog, ExecArg earg
errno = Errno.ENOENT;
return -1;
}

status = runtime.getPosix().posix_spawnp(
prog,
eargp.fileActions,
22 changes: 1 addition & 21 deletions spec/tags/ruby/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
fails:Kernel.spawn joins a new process group if pgroup: true
fails:Kernel.spawn redirects STDERR to the given file if err: String
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:Kernel.spawn redirects STDOUT to the given file if out: String
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 calls #to_str to convert the environment values
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
@@ -16,29 +13,15 @@ critical(runs very long before failing):Kernel#spawn redirects STDERR to the giv
fails:Kernel#spawn does NOT redirect both STDERR and STDOUT at the time to the given name
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 does not subject the arguments to shell expansion
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 calls #to_str to convert the environment values
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 raises an ArgumentError when passed a string key in options
fails:Kernel.spawn raises an ArgumentError when passed an unknown option key
fails:Kernel.spawn with a single argument raises an ArgumentError if the command includes a null byte
fails:Kernel.spawn with a single argument raises a TypeError if the argument does not respond to #to_str
fails:Kernel.spawn with multiple arguments raises an ArgumentError if an argument includes a null byte
fails:Kernel.spawn with multiple arguments raises a TypeError if an argument does not respond to #to_str
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 with a command array raises an ArgumentError if the Strings in the Array include a null byte
fails:Kernel.spawn with a command array raises a TypeError if an element in the Array does not respond to #to_str
fails:Kernel.spawn does NOT redirect both STDERR and STDOUT at the time to the given name
fails(only in full runs):Kernel.spawn with multiple arguments does not subject the arguments to shell expansion
fails:Kernel#spawn with Integer option keys maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value
fails:Kernel.spawn when passed :chdir changes to the directory passed for :chdir
fails:Kernel.spawn when passed :chdir calls #to_path to convert the :chdir value
fails:Kernel.spawn with Integer option keys maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value
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
@@ -49,10 +32,7 @@ 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
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
fails:Kernel#spawn when passed close_others: false closes file descriptors >= 3 in the child process because they are set close_on_exec by default
fails:Kernel.spawn when passed close_others: false closes file descriptors >= 3 in the child process because they are set close_on_exec by default
fails:Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel.spawn redirects STDOUT to the given file if out: [String name, String mode]
windows:Kernel#spawn executes the given command
windows:Kernel#spawn returns the process ID of the new process as a Fixnum
windows:Kernel#spawn returns immediately