aboutsummaryrefslogtreecommitdiffstats
path: root/disabled_protos.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-22 10:05:01 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-22 10:05:01 +0000
commitdf7289bb99180fc661260ab209c84d481e530572 (patch)
tree8b8b1a717fc59ec3f3246e15754902053b4a9f18 /disabled_protos.c
parent03f0e46d6f41fab84c927eb6b340df6afd030410 (diff)
Note that, given that ws_rename() is a wrapper around ws_stdio_rename()
on Windows, and that ws_stdio_rename() uses MoveFileEx() with MOVEFILE_REPLACE_EXISTING and should therefore remove the target if it exists, the extra "remove the target first" stuff should not be necessary on Windows - if we remove it, it also keeps the code from removing the target and then having the rename fail, with the result that the target no longer exists. svn path=/trunk/; revision=42776
Diffstat (limited to 'disabled_protos.c')
-rw-r--r--disabled_protos.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/disabled_protos.c b/disabled_protos.c
index fc6bfc2bc2..86e9aa4a99 100644
--- a/disabled_protos.c
+++ b/disabled_protos.c
@@ -382,7 +382,14 @@ save_disabled_protos_list(char **pref_path_return, int *errno_return)
/* ANSI C doesn't say whether "rename()" removes the target if it
exists; the Win32 call to rename files doesn't do so, which I
infer is the reason why the MSVC++ "rename()" doesn't do so.
- We must therefore remove the target file first, on Windows. */
+ We must therefore remove the target file first, on Windows.
+
+ XXX - ws_rename() should be ws_stdio_rename() on Windows,
+ and ws_stdio_rename() uses MoveFileEx() with MOVEFILE_REPLACE_EXISTING,
+ so it should remove the target if it exists, so this stuff
+ shouldn't be necessary. Perhaps it dates back to when we were
+ calling rename(), with that being a wrapper around Microsoft's
+ _rename(), which didn't remove the target. */
if (ws_remove(ff_path) < 0 && errno != ENOENT) {
/* It failed for some reason other than "it's not there"; if
it's not there, we don't need to remove it, so we just