file.c.rb_stat_new.patch

Eric Hodel, 03/11/2013 12:31 PM

Download (1.83 KB)

View differences:

file.c (working copy)
305 305
    return TypedData_Wrap_Struct(klass, &stat_data_type, nst);
306 306
}
307 307

  
308
static VALUE
309
stat_new(struct stat *st)
308
VALUE
309
rb_stat_new(struct stat *st)
310 310
{
311 311
    return stat_new_0(rb_cStat, st);
312 312
}
......
917 917
    if (rb_stat(fname, &st) < 0) {
918 918
	rb_sys_fail_path(fname);
919 919
    }
920
    return stat_new(&st);
920
    return rb_stat_new(&st);
921 921
}
922 922

  
923 923
/*
......
945 945
    if (fstat(fptr->fd, &st) == -1) {
946 946
	rb_sys_fail_path(fptr->pathv);
947 947
    }
948
    return stat_new(&st);
948
    return rb_stat_new(&st);
949 949
}
950 950

  
951 951
/*
......
974 974
    if (lstat(StringValueCStr(fname), &st) == -1) {
975 975
	rb_sys_fail_path(fname);
976 976
    }
977
    return stat_new(&st);
977
    return rb_stat_new(&st);
978 978
#else
979 979
    return rb_file_s_stat(klass, fname);
980 980
#endif
......
1009 1009
    if (lstat(RSTRING_PTR(path), &st) == -1) {
1010 1010
	rb_sys_fail_path(fptr->pathv);
1011 1011
    }
1012
    return stat_new(&st);
1012
    return rb_stat_new(&st);
1013 1013
#else
1014 1014
    return rb_io_stat(obj);
1015 1015
#endif
include/ruby/intern.h (working copy)
31 31
#else
32 32
# include <varargs.h>
33 33
#endif
34
#include <sys/stat.h>
34 35
#include "ruby/st.h"
35 36

  
36 37
#if defined __GNUC__ && __GNUC__ >= 4
......
434 435
VALUE rb_file_directory_p(VALUE,VALUE);
435 436
VALUE rb_str_encode_ospath(VALUE);
436 437
int rb_is_absolute_path(const char *);
438
VALUE rb_stat_new(struct stat *);
437 439
/* gc.c */
438 440
NORETURN(void rb_memerror(void));
439 441
int rb_during_gc(void);