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 | 817a62de81d75c73cceb453301ef27b094f17c14 (patch) | |
tree | 65e06d76c544a8d80296d686bf88ec3af41fdc50 /error.c | |
parent | 5cffff58445b5aec50bd4abe2198bf84b8dd68c4 (diff) | |
download | ruby-817a62de81d75c73cceb453301ef27b094f17c14.tar.gz ruby-817a62de81d75c73cceb453301ef27b094f17c14.tar.xz ruby-817a62de81d75c73cceb453301ef27b094f17c14.zip |
2000-05-01
git-svn-id: http://svn.ruby-lang.org/repos/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); |