===(p1)
public
Return true if the receiver is a generic SystemCallError, or if the error
numbers self and other are the same.
Show source
static VALUE
syserr_eqq(VALUE self, VALUE exc)
{
VALUE num, e;
ID en;
CONST_ID(en, "errno");
if (!rb_obj_is_kind_of(exc, rb_eSystemCallError)) {
if (!rb_respond_to(exc, en)) return Qfalse;
}
else if (self == rb_eSystemCallError) return Qtrue;
num = rb_attr_get(exc, rb_intern("errno"));
if (NIL_P(num)) {
num = rb_funcall(exc, en, 0, 0);
}
e = rb_const_get(self, rb_intern("Errno"));
if (FIXNUM_P(num) ? num == e : rb_equal(num, e))
return Qtrue;
return Qfalse;
}