diff options
-rw-r--r-- | coreutils/test.c | 4 | ||||
-rw-r--r-- | win32/mingw.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index 6b16ffeb1..9e709a709 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -643,10 +643,6 @@ static int filstat(char *nm, enum token mode) | |||
643 | } | 643 | } |
644 | 644 | ||
645 | #if ENABLE_PLATFORM_MINGW32 | 645 | #if ENABLE_PLATFORM_MINGW32 |
646 | #undef R_OK | ||
647 | #define R_OK S_IREAD | ||
648 | #undef W_OK | ||
649 | #define W_OK S_IWRITE | ||
650 | if (mode == FILEX) { | 646 | if (mode == FILEX) { |
651 | char *p; | 647 | char *p; |
652 | 648 | ||
diff --git a/win32/mingw.c b/win32/mingw.c index 4b5701b2d..fe45589c2 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -228,6 +228,7 @@ static int do_lstat(int follow, const char *file_name, struct mingw_stat *buf) | |||
228 | { | 228 | { |
229 | int err; | 229 | int err; |
230 | WIN32_FILE_ATTRIBUTE_DATA fdata; | 230 | WIN32_FILE_ATTRIBUTE_DATA fdata; |
231 | mode_t usermode; | ||
231 | 232 | ||
232 | if (!(err = get_file_attr(file_name, &fdata))) { | 233 | if (!(err = get_file_attr(file_name, &fdata))) { |
233 | int len = strlen(file_name); | 234 | int len = strlen(file_name); |
@@ -265,6 +266,8 @@ static int do_lstat(int follow, const char *file_name, struct mingw_stat *buf) | |||
265 | FindClose(handle); | 266 | FindClose(handle); |
266 | } | 267 | } |
267 | } | 268 | } |
269 | usermode = buf->st_mode & S_IRWXU; | ||
270 | buf->st_mode |= (usermode >> 3) | ((usermode >> 6) & ~S_IWOTH); | ||
268 | 271 | ||
269 | /* | 272 | /* |
270 | * Assume a block is 4096 bytes and calculate number of 512 byte | 273 | * Assume a block is 4096 bytes and calculate number of 512 byte |