diff options
author | ache <ache@FreeBSD.org> | 1999-11-13 20:04:41 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1999-11-13 20:04:41 +0000 |
commit | 91b25fa7a9d94c9097d6ebf1d8ec6b1a332f8e04 (patch) | |
tree | f91cc7a7248d536f4ef62308b71d193f38ed8bd1 /contrib/perl5/ext/POSIX | |
parent | 6a94fdb9f3c5c6dd5ed090a23747cc2438223a43 (diff) | |
download | FreeBSD-src-91b25fa7a9d94c9097d6ebf1d8ec6b1a332f8e04.zip FreeBSD-src-91b25fa7a9d94c9097d6ebf1d8ec6b1a332f8e04.tar.gz |
Fix time printing bug
PR: 14813
Submitted by: idea by netch@lucky.net (Valentin Nechayev)
Diffstat (limited to 'contrib/perl5/ext/POSIX')
-rw-r--r-- | contrib/perl5/ext/POSIX/POSIX.xs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/perl5/ext/POSIX/POSIX.xs b/contrib/perl5/ext/POSIX/POSIX.xs index 15e026e..093cc99 100644 --- a/contrib/perl5/ext/POSIX/POSIX.xs +++ b/contrib/perl5/ext/POSIX/POSIX.xs @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ #ifdef WIN32 #define _POSIX_ #endif @@ -3619,7 +3620,9 @@ strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) char tmpbuf[128]; struct tm mytm; int len; +#ifndef __FreeBSD__ init_tm(&mytm); /* XXX workaround - see init_tm() above */ +#endif mytm.tm_sec = sec; mytm.tm_min = min; mytm.tm_hour = hour; @@ -3629,7 +3632,12 @@ strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) mytm.tm_wday = wday; mytm.tm_yday = yday; mytm.tm_isdst = isdst; +#ifdef __FreeBSD__ + mytm.tm_gmtoff = 0; + mytm.tm_zone = "???"; +#else (void) mktime(&mytm); +#endif len = strftime(tmpbuf, sizeof tmpbuf, fmt, &mytm); /* ** The following is needed to handle to the situation where |