fixed compilation problem in SetTimes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-10-30 15:34:15 +00:00
parent 87948f22dd
commit 246c704fca

View File

@ -899,9 +899,17 @@ bool wxFileName::SetTimes(const wxDateTime *dtCreate,
const wxDateTime *dtMod)
{
#if defined(__UNIX_LIKE__)
if ( !dtAccess && !dtMod )
{
// can't modify the creation time anyhow, don't try
return TRUE;
}
// if dtAccess or dtMod is not specified, use the other one (which must be
// non NULL because of the test above) for both times
utimbuf utm;
utm.actime = dtAccess ? dtAccess : dtAccess->GetTicks();
utm.modtime = dtMod ? dtMod : dtMod->GetTicks();
utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks();
utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks();
if ( utime(GetFullPath(), &utm) == 0 )
{
return TRUE;