diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-22 10:05:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-22 10:05:01 +0000 |
commit | df7289bb99180fc661260ab209c84d481e530572 (patch) | |
tree | 8b8b1a717fc59ec3f3246e15754902053b4a9f18 /disabled_protos.c | |
parent | 03f0e46d6f41fab84c927eb6b340df6afd030410 (diff) | |
download | wireshark-df7289bb99180fc661260ab209c84d481e530572.tar.gz wireshark-df7289bb99180fc661260ab209c84d481e530572.tar.bz2 wireshark-df7289bb99180fc661260ab209c84d481e530572.zip |
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.c | 9 |
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 |