]> git.saurik.com Git - wxWidgets.git/commitdiff
Set the file name for temporary wxFFile objects.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Jan 2012 19:38:45 +0000 (19:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Jan 2012 19:38:45 +0000 (19:38 +0000)
Pass the name of the temporary file to wxFFile::Attach(). This allows to give
more useful error messages if any operation on this file fails later.

Closes #13903.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filename.cpp

index 105bc2600736cb7f30389a7e783ea0cc85229864..f90221af89b4a5343d35370890afe3b17871f37b 100644 (file)
@@ -805,7 +805,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose)
     int fd = wxTempOpen(path, deleteOnClose);
     if (fd == -1)
         return false;
-    file->Attach(wx_fdopen(fd, "w+b"));
+    file->Attach(wx_fdopen(fd, "w+b"), path);
     return file->IsOpened();
 #endif // wx_fdopen
 }
@@ -916,7 +916,7 @@ static wxString wxCreateTempImpl(
         if ( ffileTemp )
         {
         #ifdef wx_fdopen
-            ffileTemp->Attach(wx_fdopen(fdTemp, "r+b"));
+            ffileTemp->Attach(wx_fdopen(fdTemp, "r+b"), path);
         #else
             ffileTemp->Open(path, wxT("r+b"));
             close(fdTemp);