diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-01 09:42:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-01 09:42:38 +0000 |
commit | fedf48986da718580062d081dda38c4ee182c254 (patch) | |
tree | 65e06d76c544a8d80296d686bf88ec3af41fdc50 /error.c | |
parent | acbb1c943457d3b8802f099ee0e34331bc78bd38 (diff) | |
download | ruby-fedf48986da718580062d081dda38c4ee182c254.tar.gz |
2000-05-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/************************************************ +/********************************************************************** error.c - @@ -8,7 +8,7 @@ Copyright (C) 1993-2000 Yukihiro Matsumoto -************************************************/ +**********************************************************************/ #include "ruby.h" #include "env.h" @@ -404,6 +404,7 @@ typedef struct { int n; } syserr_index_entry; +static VALUE syserr_error; static VALUE syserr_list_b_general[16+1]; static VALUE syserr_list_b_os0[2+1]; static VALUE syserr_list_b_os1[5+1]; @@ -464,6 +465,11 @@ set_syserr(i, name) VALUE error = rb_define_class_under(rb_mErrno, name, rb_eSystemCallError); rb_define_const(error, "Errno", INT2FIX(i)); #ifdef __BEOS__ + if (i == B_ERROR) { + syserr_error = error; + rb_global_variable(&syserr_error); + return error; + } i -= B_GENERAL_ERROR_BASE; ix = (i >> 12) & 0xf; offset = (i >> 8) & 0xf; @@ -497,6 +503,7 @@ get_syserr(int i) VALUE *list; int ix, offset; + if (i == B_ERROR) return syserr_error; i -= B_GENERAL_ERROR_BASE; ix = (i >> 12) & 0xf; offset = (i >> 8) & 0xf; @@ -690,6 +697,7 @@ init_syserr() MEMZERO(syserr_list[ix + offset].list, VALUE, syserr_list[ix + offset].n); } } + set_syserr(B_ERROR, "ERROR"); #else syserr_list = ALLOC_N(VALUE, sys_nerr+1); MEMZERO(syserr_list, VALUE, sys_nerr+1); |