From 5fb7052bb9dacd30f2a5e4241c87613009135dfe Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 26 Feb 2009 04:31:21 +0000 Subject: * util.c (valid_filename): use our own implementation of open(), close() and unlink(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index f2b38420b8..2297e2f99f 100644 --- a/util.c +++ b/util.c @@ -20,14 +20,6 @@ #ifdef _WIN32 #include "missing/file.h" #endif -#if defined(__CYGWIN32__) -#define _open open -#define _close close -#define _unlink unlink -#define _access access -#elif defined(_WIN32) -#include -#endif #include "ruby/util.h" @@ -345,9 +337,9 @@ valid_filename(const char *s) // It doesn't exist, so see if we can open it. */ - if ((fd = _open(s, O_CREAT|O_EXCL, 0666)) >= 0) { - _close(fd); - _unlink(s); /* don't leave it laying around */ + if ((fd = open(s, O_CREAT|O_EXCL, 0666)) >= 0) { + close(fd); + unlink(s); /* don't leave it laying around */ return 1; } else if (errno == EEXIST) { -- cgit v1.2.1