diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-15 03:01:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-15 03:01:52 +0000 |
commit | 625c1361e368f6f13f303de0310e6625d7b5296b (patch) | |
tree | e119ce31630c3186aa666ed4973f7fd22f4fc9a0 /error.c | |
parent | befd57c7ea203d37531798dda95eaf488ef74dee (diff) |
* configure.in (HUGE_ST_INO): check whether struct stat.st_ino
is larger than long. [ruby-dev:21194]
http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html
* error.c (syserr_eqq): errno might exceed Fixnum limit.
* error.c (Init_Exception): moved base initialization from
init_syserr().
* inits.c (rb_call_inits): postpone initializing errnos until
Bignum is available.
* ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let
keyname() and so on be declared.
* ext/curses/curses.c (curses_resizeterm, window_resize):
arguments conflicted with macros in term.h.
* ext/curses/curses.c (Curses module methods): ensure
initialized. [ruby-dev:21191]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -607,7 +607,7 @@ static VALUE syserr_eqq(self, exc) VALUE self, exc; { - VALUE num; + VALUE num, e; if (!rb_obj_is_kind_of(exc, rb_eSystemCallError)) return Qfalse; if (self == rb_eSystemCallError) return Qtrue; @@ -621,7 +621,8 @@ syserr_eqq(self, exc) } num = rb_const_get(klass, rb_intern("Errno")); } - if (rb_const_get(self, rb_intern("Errno")) == num) + e = rb_const_get(self, rb_intern("Errno")); + if (FIXNUM_P(num) ? num == e : rb_equal(num, e)) return Qtrue; return Qfalse; } @@ -671,7 +672,13 @@ Init_Exception() rb_eSecurityError = rb_define_class("SecurityError", rb_eStandardError); rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException); - init_syserr(); + syserr_tbl = st_init_numtable(); + rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); + rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); + rb_define_method(rb_eSystemCallError, "errno", syserr_errno, 0); + rb_define_singleton_method(rb_eSystemCallError, "===", syserr_eqq, 1); + + rb_mErrno = rb_define_module("Errno"); rb_define_global_function("warn", rb_warn_m, 1); } @@ -805,16 +812,9 @@ rb_check_frozen(obj) if (OBJ_FROZEN(obj)) rb_error_frozen(rb_obj_classname(obj)); } -static void -init_syserr() +void +Init_syserr() { - syserr_tbl = st_init_numtable(); - rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); - rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); - rb_define_method(rb_eSystemCallError, "errno", syserr_errno, 0); - rb_define_singleton_method(rb_eSystemCallError, "===", syserr_eqq, 1); - - rb_mErrno = rb_define_module("Errno"); #ifdef EPERM set_syserr(EPERM, "EPERM"); #endif |