From: Michael Wetherell Date: Tue, 7 Nov 2006 23:48:24 +0000 (+0000) Subject: Fix for CreateTempFileName with wxFFile for Windows. Also _open_osfhandle X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/693bfcafb650afc9d19998fd18db88cf41815984 Fix for CreateTempFileName with wxFFile for Windows. Also _open_osfhandle requires O_BINARY on Borland, and the others don't seem to mind it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 88fe2d48ea..cd32280ec6 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -619,7 +619,7 @@ static int wxOpenWithDeleteOnClose(const wxString& filename) HANDLE h = ::CreateFile(filename, access, 0, NULL, disposition, attributes, NULL); - return wxOpenOSFHandle(h, 0); + return wxOpenOSFHandle(h, wxO_BINARY); } #endif // wxOpenOSFHandle @@ -649,7 +649,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose) return file->Open(path, _T("w+b")); #else // wx_fdopen int fd = wxTempOpen(path, deleteOnClose); - if (fd != -1) + if (fd == -1) return false; file->Attach(wx_fdopen(fd, "w+b")); return file->IsOpened();