svn commit: samba r10523 - in
branches/SAMBA_4_0/source/lib/replace: .
tridge at samba.org
tridge at samba.org
Tue Sep 27 02:36:57 GMT 2005
Author: tridge
Date: 2005-09-27 02:36:56 +0000 (Tue, 27 Sep 2005)
New Revision: 10523
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10523
Log:
fixed timegm() to not depend on get_time_zone(), so it works in lib/replace/
the old timegm() replacement was also broken (it returned the wrong value)
Modified:
branches/SAMBA_4_0/source/lib/replace/replace.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2005-09-27 01:26:34 UTC (rev 10522)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2005-09-27 02:36:56 UTC (rev 10523)
@@ -369,18 +369,8 @@
*/
time_t timegm(struct tm *tm)
{
- struct tm tm2, tm3;
- time_t t;
-
- tm2 = *tm;
-
- t = mktime(&tm2);
- tm3 = *localtime(&t);
- tm2 = *tm;
- tm2.tm_isdst = tm3.tm_isdst;
- t = mktime(&tm2);
- t -= get_time_zone(t);
-
+ time_t t = mktime(tm);
+ t -= mktime(gmtime(&t)) - (int)mktime(localtime(&t));
return t;
}
#endif
More information about the samba-cvs
mailing list