]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for CreateTempFileName with wxFFile for Windows. Also _open_osfhandle
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Tue, 7 Nov 2006 23:48:24 +0000 (23:48 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Tue, 7 Nov 2006 23:48:24 +0000 (23:48 +0000)
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

src/common/filename.cpp

index 88fe2d48eadcdf14656189354bbd646d1b02dd06..cd32280ec627343faddc355a7055fce62820ce6e 100644 (file)
@@ -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();