diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-04-15 01:25:04 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-04-15 21:05:39 +0900 |
commit | 155f64e3c4ba23f0e85e8d69facceb21a487dccd (patch) | |
tree | f0c79b8bc3ddeedd98326dc45a5dd8cfc1917d08 /eval_error.c | |
parent | d72fd1e45b192ab507f8170ceec1328c2aae7bb1 (diff) |
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]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3035
Diffstat (limited to 'eval_error.c')
-rw-r--r-- | eval_error.c | 4 |
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); } |