summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 11:54:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 11:54:53 +0000
commitc07c33b28a5a3015e995a63ece9d771cae6699d1 (patch)
tree7d4ee4b546cf8d57d04075b1f464ec8181b22720 /file.c
parentf09b772de6d7ce3710a55da99c88ea683f2f8b2b (diff)
file.c: export rb_stat_new
* file.c (stat_new_0): constify. * file.c (rb_stat_new): constify and export. based on a patch by Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/file.c b/file.c
index bb2403ec69..25c2e9a374 100644
--- a/file.c
+++ b/file.c
@@ -365,7 +365,7 @@ static const rb_data_type_t stat_data_type = {
};
static VALUE
-stat_new_0(VALUE klass, struct stat *st)
+stat_new_0(VALUE klass, const struct stat *st)
{
struct stat *nst = 0;
@@ -376,8 +376,8 @@ stat_new_0(VALUE klass, struct stat *st)
return TypedData_Wrap_Struct(klass, &stat_data_type, nst);
}
-static VALUE
-stat_new(struct stat *st)
+VALUE
+rb_stat_new(const struct stat *st)
{
return stat_new_0(rb_cStat, st);
}
@@ -987,7 +987,7 @@ rb_file_s_stat(VALUE klass, VALUE fname)
if (rb_stat(fname, &st) < 0) {
rb_sys_fail_path(fname);
}
- return stat_new(&st);
+ return rb_stat_new(&st);
}
/*
@@ -1015,7 +1015,7 @@ rb_io_stat(VALUE obj)
if (fstat(fptr->fd, &st) == -1) {
rb_sys_fail_path(fptr->pathv);
}
- return stat_new(&st);
+ return rb_stat_new(&st);
}
/*
@@ -1044,7 +1044,7 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
if (lstat(StringValueCStr(fname), &st) == -1) {
rb_sys_fail_path(fname);
}
- return stat_new(&st);
+ return rb_stat_new(&st);
#else
return rb_file_s_stat(klass, fname);
#endif
@@ -1079,7 +1079,7 @@ rb_file_lstat(VALUE obj)
if (lstat(RSTRING_PTR(path), &st) == -1) {
rb_sys_fail_path(fptr->pathv);
}
- return stat_new(&st);
+ return rb_stat_new(&st);
#else
return rb_io_stat(obj);
#endif