summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dir.c8
-rw-r--r--file.c14
-rw-r--r--ruby.h4
3 files changed, 11 insertions, 15 deletions
diff --git a/dir.c b/dir.c
index acd1fa506c..a1b14348f2 100644
--- a/dir.c
+++ b/dir.c
@@ -62,7 +62,7 @@ char *strchr _((char*,char));
#include <ctype.h>
#ifndef HAVE_LSTAT
-#define lstat rb_sys_stat
+#define lstat(path,st) stat(path,st)
#endif
#define FNM_NOESCAPE 0x01
@@ -622,7 +622,7 @@ glob_helper(path, flag, func, arg)
if (!has_magic(path, 0)) {
remove_backslashes(path);
- if (rb_sys_stat(path, &st) == 0) {
+ if (stat(path, &st) == 0) {
(*func)(path, arg);
}
else if (errno != ENOENT) {
@@ -653,7 +653,7 @@ glob_helper(path, flag, func, arg)
else dir = base;
magic = extract_elem(p);
- if (rb_sys_stat(dir, &st) < 0) {
+ if (stat(dir, &st) < 0) {
if (errno != ENOENT) rb_sys_warning(dir);
free(base);
break;
@@ -721,7 +721,7 @@ glob_helper(path, flag, func, arg)
free(magic);
if (link) {
while (link) {
- if (rb_sys_stat(link->path, &st) == 0) {
+ if (stat(link->path, &st) == 0) {
if (S_ISDIR(st.st_mode)) {
int len = strlen(link->path);
int mlen = strlen(m);
diff --git a/file.c b/file.c
index dcc1c1e89b..84d79a9291 100644
--- a/file.c
+++ b/file.c
@@ -67,7 +67,7 @@ char *strrchr _((const char*,const char));
#include <sys/stat.h>
#ifndef HAVE_LSTAT
-#define lstat stat
+#define lstat(path,st) stat(path,st)
#endif
VALUE rb_cFile;
@@ -313,7 +313,7 @@ rb_stat(file, st)
#if defined DJGPP
if (RSTRING(file)->len == 0) return -1;
#endif
- return rb_sys_stat(RSTRING(file)->ptr, st);
+ return stat(RSTRING(file)->ptr, st);
}
static VALUE
@@ -323,7 +323,7 @@ rb_file_s_stat(obj, fname)
struct stat st;
Check_SafeStr(fname);
- if (rb_sys_stat(RSTRING(fname)->ptr, &st) == -1) {
+ if (stat(RSTRING(fname)->ptr, &st) == -1) {
rb_sys_fail(RSTRING(fname)->ptr);
}
return stat_new(&st);
@@ -419,7 +419,7 @@ eaccess(path, mode)
struct stat st;
static int euid = -1;
- if (rb_sys_stat(path, &st) < 0) return (-1);
+ if (stat(path, &st) < 0) return (-1);
if (euid == -1)
euid = geteuid ();
@@ -721,7 +721,7 @@ check3rdbyte(file, mode)
{
struct stat st;
- if (rb_sys_stat(file, &st) < 0) return Qfalse;
+ if (stat(file, &st) < 0) return Qfalse;
if (st.st_mode & mode) return Qtrue;
return Qfalse;
}
@@ -2115,7 +2115,7 @@ path_check_1(path)
return path_check_1(buf);
}
for (;;) {
- if (rb_sys_stat(path, &st) == 0 && (st.st_mode & 002)) {
+ if (stat(path, &st) == 0 && (st.st_mode & 002)) {
if (p) *p = '/';
return 0;
}
@@ -2234,7 +2234,7 @@ rb_find_file(file)
}
path = dln_find_file(file, path);
- if (path && rb_sys_stat(path, &st) == 0) {
+ if (path && stat(path, &st) == 0) {
return path;
}
return 0;
diff --git a/ruby.h b/ruby.h
index ff7edf6c55..a9f9c11503 100644
--- a/ruby.h
+++ b/ruby.h
@@ -592,10 +592,6 @@ rb_special_const_p(VALUE obj)
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
#endif
-#ifndef rb_sys_stat
-#define rb_sys_stat stat
-#endif
-
#if defined(__cplusplus)
} /* extern "C" { */
#endif