mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
error.c (mrb_sys_fail): errno argument removed from _sys_fail.
As a side effect, `errno.h` dependency removed from `error.c`.
This commit is contained in:
+2
-5
@@ -4,7 +4,6 @@
|
||||
** See Copyright Notice in mruby.h
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <mruby.h>
|
||||
#include <mruby/array.h>
|
||||
@@ -512,16 +511,14 @@ MRB_API mrb_noreturn void
|
||||
mrb_sys_fail(mrb_state *mrb, const char *mesg)
|
||||
{
|
||||
struct RClass *sce;
|
||||
mrb_int no;
|
||||
|
||||
no = (mrb_int)errno;
|
||||
if (mrb_class_defined_id(mrb, MRB_SYM(SystemCallError))) {
|
||||
sce = mrb_class_get_id(mrb, MRB_SYM(SystemCallError));
|
||||
if (mesg != NULL) {
|
||||
mrb_funcall_id(mrb, mrb_obj_value(sce), MRB_SYM(_sys_fail), 2, mrb_fixnum_value(no), mrb_str_new_cstr(mrb, mesg));
|
||||
mrb_funcall_id(mrb, mrb_obj_value(sce), MRB_SYM(_sys_fail), 1, mrb_str_new_cstr(mrb, mesg));
|
||||
}
|
||||
else {
|
||||
mrb_funcall_id(mrb, mrb_obj_value(sce), MRB_SYM(_sys_fail), 1, mrb_fixnum_value(no));
|
||||
mrb_funcall_id(mrb, mrb_obj_value(sce), MRB_SYM(_sys_fail), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user