]> git.saurik.com Git - wxWidgets.git/commit
Fix last error display in wxLogSysError().
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Aug 2009 01:22:48 +0000 (01:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Aug 2009 01:22:48 +0000 (01:22 +0000)
commitb804f9924d38b16d5cd72ba6c55195f9b1cc5896
tree07f0ddfc44d013250fd0d6e9dd4553b506388c25
parent29a35dd5fee0e33143a39824e71aefd66e3e4851
Fix last error display in wxLogSysError().

After recent changes of wxLogXXX() functions into macros the last error was
overwritten by wxString::Format() called between the call to wxLogSysError()
and wxLog::CallDoLogNow() which called wxSysErrorCode() and so its original
value was lost and, unless the last error was specified explicitly, it always
came out as 0.

To fix this, call wxSysErrorCode() directly when calling wxLogSysError(). This
may be unnecessary (if the error is given explicitly) but there doesn't seem
to be any other way to fix it and the overhead of calling wxSysErrorCode()
shouldn't be that big.

Also add a unit test checking that wxLogSysError() behaves as expected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/log.h
src/common/log.cpp
tests/log/logtest.cpp