From d8b130867ce69cc7ae59f85aea7332306abd326e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Jan 2012 19:38:45 +0000 Subject: [PATCH] Set the file name for temporary wxFFile objects. 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 105bc26007..f90221af89 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -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); -- 2.45.2