--------------------- PatchSet 8672 Date: 2006/09/22 11:34:51 Author: serassio Branch: nt Tag: (none) Log: Fix wrong file mode detection Members: src/fs/coss/aio_win32.c:1.1.2.4->1.1.2.5 Index: squid/src/fs/coss/aio_win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/Attic/aio_win32.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/src/fs/coss/aio_win32.c 17 Sep 2006 09:14:37 -0000 1.1.2.4 +++ squid/src/fs/coss/aio_win32.c 22 Sep 2006 11:34:51 -0000 1.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: aio_win32.c,v 1.1.2.4 2006/09/17 09:14:37 serassio Exp $ + * $Id: aio_win32.c,v 1.1.2.5 2006/09/22 11:34:51 serassio Exp $ * * DEBUG: section 81 aio_xxx() POSIX emulation on Windows * AUTHOR: Guido Serassio @@ -155,14 +155,16 @@ int fd; errno = 0; - if (FILE_MODE(mode) == O_WRONLY) + if (mode & O_WRONLY) + mode |= O_APPEND; + if (mode & O_WRONLY) dwDesiredAccess = GENERIC_WRITE; else - dwDesiredAccess = (FILE_MODE(mode) == O_RDONLY) ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE; - if (FILE_MODE(mode) == O_TRUNC) + dwDesiredAccess = (mode & O_RDONLY) ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE; + if (mode & O_TRUNC) dwCreationDisposition = CREATE_ALWAYS; else - dwCreationDisposition = (FILE_MODE(mode) == O_CREAT) ? OPEN_ALWAYS : OPEN_EXISTING; + dwCreationDisposition = (mode & O_CREAT) ? OPEN_ALWAYS : OPEN_EXISTING; if ((hndl = CreateFile(path, /* file name */ dwDesiredAccess, /* access mode */ @@ -194,4 +196,4 @@ statCounter.syscalls.disk.closes++; } -#endif /* SQUID_MSWIN_ */ +#endif /* _SQUID_MSWIN_ */