aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 01:25:04 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 21:05:39 +0900
commit155f64e3c4ba23f0e85e8d69facceb21a487dccd (patch)
treef0c79b8bc3ddeedd98326dc45a5dd8cfc1917d08 /eval_error.c
parentd72fd1e45b192ab507f8170ceec1328c2aae7bb1 (diff)
downloadruby-155f64e3c4ba23f0e85e8d69facceb21a487dccd.tar.gz
Raise EPIPE at broken pipe for the backward compatibility
Instead of SignalException for SIGPIPE, raise `Errno::EPIPE` with instance variable `signo` and re-send that signal at exit. [Feature #14413]
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval_error.c b/eval_error.c
index 847072ab98..74f09a8d8b 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -474,6 +474,10 @@ error_handle(rb_execution_context_t *ec, int ex)
rb_ivar_get(errinfo, id_signo) != INT2FIX(SIGSEGV)) {
/* no message when exiting by signal */
}
+ else if (rb_obj_is_kind_of(errinfo, rb_eSystemCallError) &&
+ FIXNUM_P(rb_attr_get(errinfo, id_signo))) {
+ /* no message when exiting by error to be mapped to signal */
+ }
else {
rb_ec_error_print(ec, errinfo);
}