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: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9cd0097bb0d8
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6d6d49edd6f5
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jun 2, 2016

  1. Properly wait for failed process status for #spawn, #`.

    If #spawn or #` fail, the PID of the subprocess isn't passed back, so it
    cannot be properly reaped by the OS with a Process.waitpid call. So we have to
    do that in the VM.
    brixen committed Jun 2, 2016
    Copy the full SHA
    43f5db8 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6d6d49e View commit details
Showing with 21 additions and 2 deletions.
  1. +4 −0 core/deprecations.rb
  2. +17 −2 machine/builtin/system.cpp
4 changes: 4 additions & 0 deletions core/deprecations.rb
Original file line number Diff line number Diff line change
@@ -4,5 +4,9 @@ module Rubinius
"Ruby 2.1 features that are incompatible with Ruby 2.2 are deprecated." =>
"Use Ruby 2.2 features if they are available.",
"Rubinius::KERNEL_PATH is deprecated." => "Use Rubinius::CORE_PATH instead.",
"Support for 32-bit platforms is deprecated." =>
"Use 64-bit platforms or open an issue if 32-bit support is a critical feature.",
"Support for the GCC compiler is deprecated." =>
"Use clang or open an issue if GCC support is a critical feature.",
}
end
19 changes: 17 additions & 2 deletions machine/builtin/system.cpp
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@
#ifndef RBX_WINDOWS
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <pwd.h>
#include <dlfcn.h>
@@ -491,7 +492,7 @@ namespace rubinius {
call_frame->file(state)->cpp_str(state).c_str(),
call_frame->line(state));

int error_no;
int error_no = 0;
ssize_t size;

while((size = read(errors[0], &error_no, sizeof(int))) < 0) {
@@ -507,6 +508,13 @@ namespace rubinius {
close(errors[0]);

if(size != 0) {
{
UnmanagedPhase unmanaged(state);
int status, options = WNOHANG;

waitpid(pid, &status, options);
}

Exception::raise_errno_error(state, "execvp(2) failed", error_no);
return NULL;
}
@@ -600,7 +608,7 @@ namespace rubinius {
call_frame->file(state)->cpp_str(state).c_str(),
call_frame->line(state));

int error_no;
int error_no = 0;
ssize_t size;

while((size = read(errors[0], &error_no, sizeof(int))) < 0) {
@@ -616,6 +624,13 @@ namespace rubinius {
close(errors[0]);

if(size != 0) {
{
UnmanagedPhase unmanaged(state);
int status, options = WNOHANG;

waitpid(pid, &status, options);
}

close(output[0]);
Exception::raise_errno_error(state, "execvp(2) failed", error_no);
return NULL;