wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories.

This commit is contained in:
Jeff Zaroyko 2008-12-03 17:30:54 +11:00 committed by Alexandre Julliard
parent f8b5aa34dc
commit afce615830
2 changed files with 2 additions and 2 deletions

View File

@ -783,7 +783,7 @@ static void test_CreateFileW(void)
ok(ret == TRUE, "couldn't create temporary directory\n");
hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
todo_wine ok(hFile != INVALID_HANDLE_VALUE,
ok(hFile != INVALID_HANDLE_VALUE,
"expected CreateFile to succeed on existing directory, error: %d\n", GetLastError());
CloseHandle(hFile);
ret = RemoveDirectoryW(filename);

View File

@ -1582,7 +1582,7 @@ struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int acce
/* if we tried to open a directory for write access, retry read-only */
if (errno != EISDIR ||
!(access & FILE_UNIX_WRITE_ACCESS) ||
(fd->unix_fd = open( name, O_RDONLY | (flags & ~O_TRUNC), *mode )) == -1)
(fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode )) == -1)
{
file_set_error();
goto error;