2009-07-30 06:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* source/common/hbdate.c
    ! Refixed for HB_HAS_LOCALTIME_R.
This commit is contained in:
Viktor Szakats
2009-07-30 04:59:48 +00:00
parent 072c6896c4
commit 0e4021d699
2 changed files with 14 additions and 10 deletions

View File

@@ -17,6 +17,10 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-30 06:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/common/hbdate.c
! Refixed for HB_HAS_LOCALTIME_R.
2009-07-30 06:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/common/hbdate.c
! Fixed typos in last modif.

View File

@@ -912,20 +912,20 @@ long hb_timeUTCOffset( void ) /* in seconds */
}
#else
{
struct tm * timeinfo;
struct tm timeinfo;
time_t current, utc, local;
time( &current );
timeinfo = gmtime( &current );
utc = mktime( timeinfo );
# if defined( HB_HAS_LOCALTIME_R )
localtime_r( &current, timeinfo );
# else
timeinfo = localtime( &current );
# endif
local = mktime( timeinfo );
utc = mktime( gmtime( &current ) );
return difftime( local, utc ) + ( timeinfo->tm_isdst ? 3600 : 0 );
#if defined( HB_HAS_LOCALTIME_R )
localtime_r( &current, &timeinfo );
#else
timeinfo = *localtime( &current );
#endif
local = mktime( &timeinfo );
return difftime( local, utc ) + ( timeinfo.tm_isdst ? 3600 : 0 );
}
#endif
}