Skip to content

Commit

Permalink
Report SignalException signo in process return code. Fixes #5134
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 12, 2018
1 parent 77a9cce commit bf4b9c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/org/jruby/Main.java
Expand Up @@ -41,6 +41,7 @@
import org.jruby.exceptions.MainExitException;
import org.jruby.exceptions.JumpException;
import org.jruby.exceptions.RaiseException;
import org.jruby.exceptions.SignalException;
import org.jruby.exceptions.ThreadKill;
import org.jruby.main.DripMain;
import org.jruby.platform.Platform;
Expand Down Expand Up @@ -530,6 +531,12 @@ protected static int handleRaiseException(final RaiseException ex) {
return RubyNumeric.fix2int(status);
}
return 0;
} else if ( runtime.getSignalException().isInstance(raisedException) ) {
IRubyObject status = raisedException.callMethod(runtime.getCurrentContext(), "signo");
if (status != null && ! status.isNil()) {
return RubyNumeric.fix2int(status) + 128;
}
return 0;
}
System.err.print(runtime.getInstanceConfig().getTraceType().printBacktrace(raisedException, runtime.getPosix().isatty(FileDescriptor.err)));
return 1;
Expand Down

0 comments on commit bf4b9c7

Please sign in to comment.