RE timegm on SOLARIS
Andrew Bartlett
abartlet at samba.org
Wed Nov 20 21:34:01 GMT 2002
On Thu, 2002-11-21 at 07:46, Clive Elsum wrote:
>
> Hi,
>
> I have not had any feedback on the replacement module for timegm within
> /lib/replace.c. This fix allows a correct Solaris build, without it Clock Skew
> errors occur unless the machine is dropped back to GMT. Is there any chance of
> this being implemented?
I was hoping that somebody else would give a reaction :-)
I'll try to get to it,
Andrew Bartlett
> Thanks in advance
>
> Clive
>
> Original message attached
>
> Delivered-To: samba-technical at lists.samba.org
> From: Clive.Elsum at csiro.au
> To: samba-technical at lists.samba.org
> Cc: abartlet at samba.org, davecb at canada.sun.com
> Subject: FIX to RE: Cannot get net ads join to work under Solaris 8
> MIME-Version: 1.0
> X-BeenThere: samba-technical at lists.samba.org
> X-Mailman-Version: 2.0.13
> List-Help: <mailto:samba-technical-request at lists.samba.org?subject=help>
> List-Post: <mailto:samba-technical at lists.samba.org>
> List-Subscribe: <http://lists.samba.org/mailman/listinfo/samba-technical>,
> <mailto:samba-technical-request at lists.samba.org?subject=subscribe>
> List-Id: Discussions on Samba internals. For general questions please subscribe
> to the list samba at samba.org <samba-technical.lists.samba.org>
> List-Unsubscribe: <http://lists.samba.org/mailman/listinfo/samba-technical>,
> <mailto:samba-technical-request at lists.samba.org?subject=unsubscribe>
> List-Archive: <http://lists.samba.org/pipermail/samba-technical/>
> X-Original-Date: Sun, 17 Nov 2002 19:33:23 +1100
> Date: Sun, 17 Nov 2002 19:33:23 +1100
>
> Andrew,
>
> Another suggestion which appears to work without a kludge is a very minor
> mod to the code originally contributed by Roger Beeman <beeman at cisco.com>,
> with the help of Mark Baushke <mdb at cisco.com> and the rest of the Gurus at
> CISCO. Further improved by Roger with assistance from Edward J. Sabol based
> on input by Jamie Zawinski.
> Setting this as a timegm replacement within lib/replace.c overcomes the need
> to reset TIMEZONE.
>
>
> time_t timegm(struct tm *t)
> {
> time_t tl, tb;
> struct tm *tg;
>
> tl = mktime (t);
> if (tl == -1)
> {
> t->tm_hour--;
> tl = mktime (t);
> if (tl == -1)
> return -1; /* can't deal with output from strptime */
> tl += 3600;
> }
> tg = gmtime (&tl);
> tg->tm_isdst = 0;
> tb = mktime (tg);
> if (tb == -1)
> {
> tg->tm_hour--;
> tb = mktime (tg);
> if (tb == -1)
> return -1; /* can't deal with output from gmtime */
> tb += 3600;
> }
> return (tl - (tb - tl));
>
>
>
> ---------------------------------------------------------------------
> Clive Elsum BAppSc, RHCE
> Systems Engineer - Information Technology Group
> CSIRO Atmospheric Research
> PMB 1, Aspendale, Victoria, Australia 3195
> Phone : (+61 3) 9239 4509
> Fax: (+61 3) 9239 4444
> E-mail Clive.Elsum at csiro.au
> ---------------------------------------------------------------------
>
--
Andrew Bartlett abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team abartlet at samba.org
Student Network Administrator, Hawker College abartlet at hawkerc.net
http://samba.org http://build.samba.org http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20021120/0722000c/attachment.bin
More information about the samba-technical
mailing list