diff options
author | Max Kellermann <max@duempel.org> | 2015-02-06 14:36:55 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-02-06 14:36:55 +0100 |
commit | d38034bb5c7bb58c01ce817fbeb394b178961a13 (patch) | |
tree | 06d613edb68a83f291c31403c564bb8955586e96 /src/fs | |
parent | b3fe3e8b3de5794762f21000d5771b0491e8a041 (diff) | |
download | mpd-d38034bb5c7bb58c01ce817fbeb394b178961a13.tar.gz mpd-d38034bb5c7bb58c01ce817fbeb394b178961a13.tar.xz mpd-d38034bb5c7bb58c01ce817fbeb394b178961a13.zip |
fs/io/FileOutputStream: don't auto-delete file on WIN32
The file handle is never reset to INVALID_HANDLE_VALUE, and thus the
destructor will assume the operation shall be cancelled and will
delete the temporary file.
This was a major breakage for saving the database file and the state
file.
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/io/FileOutputStream.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fs/io/FileOutputStream.cxx b/src/fs/io/FileOutputStream.cxx index dc4456d1f..0eff8b5f0 100644 --- a/src/fs/io/FileOutputStream.cxx +++ b/src/fs/io/FileOutputStream.cxx @@ -62,6 +62,7 @@ FileOutputStream::Commit(gcc_unused Error &error) assert(IsDefined()); CloseHandle(handle); + handle = INVALID_HANDLE_VALUE; return true; } @@ -71,6 +72,7 @@ FileOutputStream::Cancel() assert(IsDefined()); CloseHandle(handle); + handle = INVALID_HANDLE_VALUE; RemoveFile(path); } |