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]
This commit is contained in:
Nobuyoshi Nakada 2020-04-15 01:25:04 +09:00
parent d72fd1e45b
commit 155f64e3c4
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2020-04-15 22:08:49 +09:00
4 changed files with 23 additions and 9 deletions

View file

@ -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);
}