@@ -573,7 +573,6 @@ rb_provide(const char *feature)
573573 rb_provide_feature (rb_fstring_cstr (feature ));
574574}
575575
576- NORETURN (static void load_failed (VALUE ));
577576const rb_iseq_t * rb_iseq_load_iseq (VALUE fname );
578577
579578static int
@@ -654,7 +653,7 @@ static VALUE
654653file_to_load (VALUE fname )
655654{
656655 VALUE tmp = rb_find_file (FilePathValue (fname ));
657- if (!tmp ) load_failed (fname );
656+ if (!tmp ) rb_load_fail (fname , strerror ( errno ) );
658657 return tmp ;
659658}
660659
@@ -708,7 +707,7 @@ rb_f_load(int argc, VALUE *argv)
708707 path = rb_find_file (fname );
709708 if (!path ) {
710709if (!rb_file_load_ok (RSTRING_PTR (fname )))
711- load_failed (orig_fname );
710+ rb_load_fail (orig_fname , strerror ( errno ) );
712711path = fname ;
713712 }
714713 rb_load_internal (path , RTEST (wrap ));
@@ -935,12 +934,6 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level)
935934 return type ? 's' : 'r' ;
936935}
937936
938- static void
939- load_failed (VALUE fname )
940- {
941- rb_load_fail (fname , "cannot load such file" );
942- }
943-
944937static VALUE
945938load_ext (VALUE path )
946939{
@@ -1048,7 +1041,7 @@ rb_require_safe(VALUE fname, int safe)
10481041JUMP_TAG (result );
10491042 }
10501043 if (result < 0 ) {
1051- load_failed (fname );
1044+ rb_load_fail (fname , strerror ( errno ) );
10521045 }
10531046
10541047 return result ? Qtrue : Qfalse ;
0 commit comments