From 74a87a7f4f17f72beb6dda18e6aaf88fdf0ec239 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 12 Sep 2010 14:46:14 -0600 Subject: [PATCH] use _waccess on windows to implement File.can{Read|Write} --- classpath/java-io.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index 05b54da2c9..f134d6dc0c 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -25,6 +25,7 @@ # include # include +# define ACCESS _waccess # define CLOSE _close # define READ _read # define WRITE _write @@ -56,6 +57,7 @@ typedef wchar_t char_t; # include # include "sys/mman.h" +# define ACCESS access # define OPEN open # define CLOSE close # define READ read @@ -382,7 +384,7 @@ Java_java_io_File_canRead(JNIEnv* e, jclass, jstring path) { string_t chars = getChars(e, path); if (chars) { - int r = access(chars, R_OK); + int r = ACCESS(chars, R_OK); releaseChars(e, path, chars); return (r == 0); } @@ -394,7 +396,7 @@ Java_java_io_File_canWrite(JNIEnv* e, jclass, jstring path) { string_t chars = getChars(e, path); if (chars) { - int r = access(chars, W_OK); + int r = ACCESS(chars, W_OK); releaseChars(e, path, chars); return (r == 0); }