Skip to content

Commit 9ea56f8

Browse files
author
matz
committed
* ruby.h: rb_sys_stat -> stat
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 9910fee commit 9ea56f8

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

dir.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ char *strchr _((char*,char));
6262
#include <ctype.h>
6363

6464
#ifndef HAVE_LSTAT
65-
#define lstat rb_sys_stat
65+
#define lstat(path,st) stat(path,st)
6666
#endif
6767

6868
#define FNM_NOESCAPE 0x01
@@ -622,7 +622,7 @@ glob_helper(path, flag, func, arg)
622622

623623
if (!has_magic(path, 0)) {
624624
remove_backslashes(path);
625-
if (rb_sys_stat(path, &st) == 0) {
625+
if (stat(path, &st) == 0) {
626626
(*func)(path, arg);
627627
}
628628
else if (errno != ENOENT) {
@@ -653,7 +653,7 @@ glob_helper(path, flag, func, arg)
653653
else dir = base;
654654

655655
magic = extract_elem(p);
656-
if (rb_sys_stat(dir, &st) < 0) {
656+
if (stat(dir, &st) < 0) {
657657
if (errno != ENOENT) rb_sys_warning(dir);
658658
free(base);
659659
break;
@@ -721,7 +721,7 @@ glob_helper(path, flag, func, arg)
721721
free(magic);
722722
if (link) {
723723
while (link) {
724-
if (rb_sys_stat(link->path, &st) == 0) {
724+
if (stat(link->path, &st) == 0) {
725725
if (S_ISDIR(st.st_mode)) {
726726
int len = strlen(link->path);
727727
int mlen = strlen(m);

file.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ char *strrchr _((const char*,const char));
6767
#include <sys/stat.h>
6868

6969
#ifndef HAVE_LSTAT
70-
#define lstat stat
70+
#define lstat(path,st) stat(path,st)
7171
#endif
7272

7373
VALUE rb_cFile;
@@ -313,7 +313,7 @@ rb_stat(file, st)
313313
#if defined DJGPP
314314
if (RSTRING(file)->len == 0) return -1;
315315
#endif
316-
return rb_sys_stat(RSTRING(file)->ptr, st);
316+
return stat(RSTRING(file)->ptr, st);
317317
}
318318

319319
static VALUE
@@ -323,7 +323,7 @@ rb_file_s_stat(obj, fname)
323323
struct stat st;
324324

325325
Check_SafeStr(fname);
326-
if (rb_sys_stat(RSTRING(fname)->ptr, &st) == -1) {
326+
if (stat(RSTRING(fname)->ptr, &st) == -1) {
327327
rb_sys_fail(RSTRING(fname)->ptr);
328328
}
329329
return stat_new(&st);
@@ -419,7 +419,7 @@ eaccess(path, mode)
419419
struct stat st;
420420
static int euid = -1;
421421

422-
if (rb_sys_stat(path, &st) < 0) return (-1);
422+
if (stat(path, &st) < 0) return (-1);
423423

424424
if (euid == -1)
425425
euid = geteuid ();
@@ -721,7 +721,7 @@ check3rdbyte(file, mode)
721721
{
722722
struct stat st;
723723

724-
if (rb_sys_stat(file, &st) < 0) return Qfalse;
724+
if (stat(file, &st) < 0) return Qfalse;
725725
if (st.st_mode & mode) return Qtrue;
726726
return Qfalse;
727727
}
@@ -2115,7 +2115,7 @@ path_check_1(path)
21152115
return path_check_1(buf);
21162116
}
21172117
for (;;) {
2118-
if (rb_sys_stat(path, &st) == 0 && (st.st_mode & 002)) {
2118+
if (stat(path, &st) == 0 && (st.st_mode & 002)) {
21192119
if (p) *p = '/';
21202120
return 0;
21212121
}
@@ -2234,7 +2234,7 @@ rb_find_file(file)
22342234
}
22352235

22362236
path = dln_find_file(file, path);
2237-
if (path && rb_sys_stat(path, &st) == 0) {
2237+
if (path && stat(path, &st) == 0) {
22382238
return path;
22392239
}
22402240
return 0;

ruby.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,6 @@ rb_special_const_p(VALUE obj)
592592
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
593593
#endif
594594

595-
#ifndef rb_sys_stat
596-
#define rb_sys_stat stat
597-
#endif
598-
599595
#if defined(__cplusplus)
600596
} /* extern "C" { */
601597
#endif

0 commit comments

Comments
 (0)