diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-23 12:01:52 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-23 12:01:52 +0000 |
commit | b5cb5c9e642a3b868024345fd31c71052e4b0932 (patch) | |
tree | 72af33d4f99d1eb61cdf0cbc38445de436026f8f /winsup/cygwin/syscalls.cc | |
parent | 7131554a692a675bfff2d95f224c54dfdb88686c (diff) | |
download | cygnal-b5cb5c9e642a3b868024345fd31c71052e4b0932.tar.gz cygnal-b5cb5c9e642a3b868024345fd31c71052e4b0932.tar.bz2 cygnal-b5cb5c9e642a3b868024345fd31c71052e4b0932.zip |
* fhandler_console.cc (fhandler_console::need_invisible): Drop
pty_needs_alloc_console check.
* spawn.cc (spawn_guts): Ditto.
(av::fixup): Remove setting iscui.
* syscalls.cc (rename): Drop has_move_file_ex checks. Remove 9x
specific code.
* wincap.cc: Remove has_move_file_ex and pty_needs_alloc_console
throughout.
* wincap.h: Ditto.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index ed11037d9..1295a89c9 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1418,20 +1418,12 @@ rename (const char *oldpath, const char *newpath) code instead. The order in the condition is (hopefully) trimmed for doing the least - expensive stuff first. Nevertheless it would be nice if 9x could - generate the same error codes as NT. - NT generates ERROR_SHARING_VIOLATION in all cases, while 9x generates - ERROR_ACCESS_DENIED if the target path doesn't exist, - ERROR_ALREADY_EXISTS otherwise */ + expensive stuff first. */ int len; DWORD lasterr; lasterr = GetLastError (); if (real_old.isdir () - && ((lasterr == ERROR_SHARING_VIOLATION && wincap.has_move_file_ex ()) - || (lasterr == ERROR_ACCESS_DENIED && !real_new.exists () - && !wincap.has_move_file_ex ()) - || (lasterr == ERROR_ALREADY_EXISTS && real_new.exists () - && !wincap.has_move_file_ex ())) + && lasterr == ERROR_SHARING_VIOLATION && (len = strlen (real_old), strncasematch (real_old, real_new, len)) && real_new[len] == '\\') SetLastError (ERROR_INVALID_PARAMETER); @@ -1444,31 +1436,9 @@ rename (const char *oldpath, const char *newpath) else if (MoveFile (real_old, real_new)) res = 0; } - else if (wincap.has_move_file_ex ()) - { - if (MoveFileEx (real_old.get_win32 (), real_new.get_win32 (), - MOVEFILE_REPLACE_EXISTING)) - res = 0; - } - else if (lasterr == ERROR_ALREADY_EXISTS || lasterr == ERROR_FILE_EXISTS) - { - syscall_printf ("try win95 hack"); - for (int i = 0; i < 2; i++) - { - if (!DeleteFileA (real_new) && - GetLastError () != ERROR_FILE_NOT_FOUND) - { - syscall_printf ("deleting %s to be paranoid", - real_new.get_win32 ()); - break; - } - else if (MoveFile (real_old, real_new)) - { - res = 0; - break; - } - } - } + else if (MoveFileEx (real_old.get_win32 (), real_new.get_win32 (), + MOVEFILE_REPLACE_EXISTING)) + res = 0; done: if (res) |