diff options
author | unknown <heikki@hundin.mysql.fi> | 2005-01-28 20:58:16 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2005-01-28 20:58:16 +0200 |
commit | c392de41b2ca3c19b3b9bfad0257dc32b6436f55 (patch) | |
tree | bad8945cff09213d28211786df13bb5bcec2bb19 /innobase | |
parent | 92ae534c40eccd5c2150b5531e3f5e1df159ab91 (diff) | |
download | mariadb-git-c392de41b2ca3c19b3b9bfad0257dc32b6436f55.tar.gz |
os0file.c:
Fix Windows porting bugs that broke ibbackup: 1) wrong error check in for CreateDirectory(), 2) wrong error check if the file did not exist in DeleteFile(), 3) too strict sharing restrictions in os_file_create_simple(): when ibbackup called that function, it would not allow mysqld to write to the file
innobase/os/os0file.c:
Fix Windows porting bugs that broke ibbackup: 1) wrong error check in for CreateDirectory(), 2) wrong error check if the file did not exist in DeleteFile(), 3) too strict sharing restrictions in os_file_create_simple(): when ibbackup called that function, it would not allow mysqld to write to the file
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/os/os0file.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 070096f4760..cc743ffad41 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -823,7 +823,7 @@ os_file_create_directory( rcode = CreateDirectory(pathname, NULL); if (!(rcode != 0 || - (GetLastError() == ERROR_FILE_EXISTS && !fail_if_exists))) { + (GetLastError() == ERROR_ALREADY_EXISTS && !fail_if_exists))) { /* failure */ os_file_handle_error(pathname, "CreateDirectory"); @@ -907,8 +907,9 @@ try_again: file = CreateFile(name, access, - FILE_SHARE_READ,/* file can be read also by other - processes */ + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read ansd written also + by other processes */ NULL, /* default security attributes */ create_flag, attributes, @@ -1013,7 +1014,7 @@ os_file_create_simple_no_error_handling( DWORD create_flag; DWORD access; DWORD attributes = 0; - DWORD share_mode = FILE_SHARE_READ; + DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; ut_a(name); @@ -1336,7 +1337,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* the file does not exist, this not an error */ return(TRUE); @@ -1397,7 +1398,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* If the file does not exist, we classify this as a 'mild' error and return */ |