summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-08 01:46:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-08 01:46:33 +0000
commit2f2cc0ddfc8785ef5cc030159fba6b040836be13 (patch)
tree8276901c0f944683c93d197655ece4ce000eeda0 /error.c
parent2a91610f3a32fa075b77d445b87dccbc4d85bd1d (diff)
* error.c (errno_missing): Errno.const_missing to allow references
to SyscallError exceptions not defined on the platform. [ruby-core:04522] * error.c (Init_syserr): Errno::NOERROR(0) for fallback exception. * eval.c (block_pass): should not push unique number if a block is not an orphan. [ruby-dev:25808] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/error.c b/error.c
index f8414060f5..91bc993542 100644
--- a/error.c
+++ b/error.c
@@ -312,6 +312,7 @@ VALUE rb_eLoadError;
VALUE rb_eSystemCallError;
VALUE rb_mErrno;
+static VALUE eNOERROR;
VALUE
rb_exc_new(etype, ptr, len)
@@ -1016,6 +1017,13 @@ syserr_eqq(self, exc)
return Qfalse;
}
+static VALUE
+errno_missing(self, id)
+ VALUE self, id;
+{
+ return eNOERROR;
+}
+
/*
* Descendents of class <code>Exception</code> are used to communicate
* between <code>raise</code> methods and <code>rescue</code>
@@ -1085,6 +1093,7 @@ Init_Exception()
rb_define_singleton_method(rb_eSystemCallError, "===", syserr_eqq, 1);
rb_mErrno = rb_define_module("Errno");
+ rb_define_singleton_method(rb_mErrno, "const_missing", errno_missing, 1);
rb_define_global_function("warn", rb_warn_m, 1);
}
@@ -1587,6 +1596,7 @@ Init_syserr()
#ifdef EDQUOT
set_syserr(EDQUOT, "EDQUOT");
#endif
+ eNOERROR = set_syserr(0, "NOERROR");
}
static void