PATCH: dlls/msvcrt/file.c and POSIX (retry)
Francois Gouget
fgouget at codeweavers.com
Wed Sep 26 16:32:15 CDT 2001
Gerald Pfeifer wrote:
>
> I had sent the following fix to Alexandre four resp. two weeks ago, but
> didn't get any response.
>
> Is there any specific problem with this fix? (I'm confident that with
> this patch we are better off than without.)
The problem is that the value for the Windows W_OK may not match that
of Unix. Actually, W_OK does not even exist on Windows, they just say to
use 2. Finally, W_OK is not used anywhere else AFAICS (note that the
others use the unix access function). So I propose the attached patch
instead.
--
Francois Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/file.c,v
retrieving revision 1.9
diff -u -r1.9 file.c
--- dlls/msvcrt/file.c 2001/07/23 18:02:18 1.9
+++ dlls/msvcrt/file.c 2001/09/26 20:06:22
@@ -33,7 +33,7 @@
#define MSVCRT_S_IEXEC (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
/* _access() bit flags FIXME: incomplete */
-#define W_OK 2
+#define MSVCRT_W_OK 0x02
/* FIXME: Make this dynamic */
@@ -202,7 +202,7 @@
MSVCRT__set_errno(GetLastError());
return -1;
}
- if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & W_OK))
+ if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
{
MSVCRT__set_errno(ERROR_ACCESS_DENIED);
return -1;
@@ -224,7 +224,7 @@
MSVCRT__set_errno(GetLastError());
return -1;
}
- if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & W_OK))
+ if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
{
MSVCRT__set_errno(ERROR_ACCESS_DENIED);
return -1;
More information about the wine-patches
mailing list