From 4713c7fb769e8e627459394291310c9a335fbbdb Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 9 Feb 2011 20:10:42 +0700 Subject: win32: test: make -r/-w work R_OK and W_OK on Windows are defined as 4 and 2 respectively. The stat() reimplementation uses S_IREAD and S_IWRITE, which are completely different value. Redefine R_OK and W_OK --- coreutils/test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreutils/test.c b/coreutils/test.c index 3e9ab7c65..caecd7d02 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -620,6 +620,10 @@ static int filstat(char *nm, enum token mode) } #if ENABLE_PLATFORM_MINGW32 +#undef R_OK +#define R_OK S_IREAD +#undef W_OK +#define W_OK S_IWRITE if (mode == FILEX) { int len = strlen(nm), ret; if (len >= 4 && -- cgit v1.2.3-55-g6feb