<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>
Hal Murray pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/9ad68de8fc7d1b2d8e1544573590e8f89314044d">9ad68de8</a></strong>
<div>
<span>by Hal Murray</span>
<i>at 2016-01-14T19:49:45-08:00</i>
</div>
<pre class='commit-message'>Remove local copy of timegm and gmtime.</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/5549b6a2c90ae5992b9956be18be1201d8f9bb7f">5549b6a2</a></strong>
<div>
<span>by Hal Murray</span>
<i>at 2016-01-14T20:23:42-08:00</i>
</div>
<pre class='commit-message'>Disconnect keyword-gen from libntp. (helps cross compile)</pre>
</li>
</ul>
<h4>6 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/ntp_machine.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
<span class='deleted-file'>

libntp/mktime.c
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
libntp/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
ntpd/keyword-gen.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
ntpd/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
pylib/configure.py
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-0'>
<strong>
include/ntp_machine.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntp_machine.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntp_machine.h
</span><span style="color: #aaaaaa">@@ -65,9 +65,5 @@ int ntp_set_tod (struct timespec *tvs);
</span> # define HAVE_NO_NICE
 #endif
 
<span style="color: #000000;background-color: #ffdddd">-#ifndef HAVE_TIMEGM
-extern time_t  timegm          (struct tm *);
-#endif
-
</span> 
 #endif /* GUARD_NTP_MACHINE_H */
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-1'>
<strong>
libntp/mktime.c
</strong>
deleted
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/mktime.c
</span><span style="color: #000000;background-color: #ddffdd">+++ /dev/null
</span><span style="color: #aaaaaa">@@ -1,273 +0,0 @@
</span><span style="color: #000000;background-color: #ffdddd">-/*
- * Copyright (c) 1987, 1989 Regents of the University of California.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: BSD-4-clause
- */
-
-/*
- * This implementation of mktime is lifted straight from the NetBSD (BSD 4.4)
- * version.  I modified it slightly to divorce it from the internals of the
- * ctime library.  Thus this version can't use details of the internal
- * timezone state file to figure out strange unnormalized struct tm values,
- * as might result from someone doing date math on the tm struct then passing
- * it to mktime.
- *
- * It just does as well as it can at normalizing the tm input, then does a
- * binary search of the time space using the system's localtime_r() function.
- *
- * The original binary search was defective in that it didn't consider the
- * setting of tm_isdst when comparing tm values, causing the search to be
- * flubbed for times near the dst/standard time changeover.  The original
- * code seems to make up for this by grubbing through the timezone info
- * whenever the binary search barfed.  Since I don't have that luxury in
- * portable code, I have to take care of tm_isdst in the comparison routine.
- * This requires knowing how many minutes offset dst is from standard time.
- *
- * So, if you live somewhere in the world where dst is not 60 minutes offset,
- * and your vendor doesn't supply mktime(), you'll have to edit this variable
- * by hand.  Sorry about that.
- */
-
-#include <config.h>
-#include "ntp_machine.h"
-
-#if !defined(HAVE_TIMEGM)
-
-#if SIZEOF_TIME_T >= 8
-#error libntp supplied mktime()/timegm() do not support 64-bit time_t
-#endif
-
-#ifndef DSTMINUTES
-#define DSTMINUTES 60
-#endif
-
-/* some constants from tzfile.h */
-#define SECSPERMIN      60
-#define MINSPERHOUR     60
-#define HOURSPERDAY     24
-#define DAYSPERWEEK     7
-#define DAYSPERNYEAR    365
-#define DAYSPERLYEAR    366
-#define SECSPERHOUR     (SECSPERMIN * MINSPERHOUR)
-#define SECSPERDAY      ((long) SECSPERHOUR * HOURSPERDAY)
-#define MONSPERYEAR     12
-#define TM_YEAR_BASE    1900
-#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
-
-static int     mon_lengths[2][MONSPERYEAR] = {
-       { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
-       { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-static int     year_lengths[2] = {
-       DAYSPERNYEAR, DAYSPERLYEAR
-};
-
-/*
-** Adapted from code provided by Robert Elz, who writes:
-**     The "best" way to do mktime I think is based on an idea of Bob
-**     Kridle's (so its said...) from a long time ago. (mtxinu!kridle now).
-**     It does a binary search of the time_t space.  Since time_t's are
-**     just 32 bits, its a max of 32 iterations (even at 64 bits it
-**     would still be very reasonable).
-*/
-
-#define WRONG  (-1)
-
-static void
-normalize(
-       int * tensptr,
-       int * unitsptr,
-       int     base
-       )
-{
-       if (*unitsptr >= base) {
-               *tensptr += *unitsptr / base;
-               *unitsptr %= base;
-       } else if (*unitsptr < 0) {
-               --*tensptr;
-               *unitsptr += base;
-               if (*unitsptr < 0) {
-                       *tensptr -= 1 + (-*unitsptr) / base;
-                       *unitsptr = base - (-*unitsptr) % base;
-               }
-       }
-}
-
-static struct tm *
-mkdst(
-       struct tm *     tmp
-       )
-{
-    /* jds */
-    static struct tm tmbuf;
-
-    tmbuf = *tmp;
-    tmbuf.tm_isdst = 1;
-    tmbuf.tm_min += DSTMINUTES;
-    normalize(&tmbuf.tm_hour, &tmbuf.tm_min, MINSPERHOUR);
-    return &tmbuf;
-}
-
-static int
-tmcomp(
-       register struct tm * atmp,
-       register struct tm * btmp
-       )
-{
-       register int    result;
-
-       /* compare down to the same day */
-
-       if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
-           (result = (atmp->tm_mon - btmp->tm_mon)) == 0)
-           result = (atmp->tm_mday - btmp->tm_mday);
-
-       if(result != 0)
-           return result;
-
-       /* get rid of one-sided dst bias */
-
-       if(atmp->tm_isdst == 1 && !btmp->tm_isdst)
-           btmp = mkdst(btmp);
-       else if(btmp->tm_isdst == 1 && !atmp->tm_isdst)
-           atmp = mkdst(atmp);
-
-       /* compare the rest of the way */
-
-       if ((result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
-           (result = (atmp->tm_min - btmp->tm_min)) == 0)
-           result = atmp->tm_sec - btmp->tm_sec;
-       return result;
-}
-
-
-static time_t
-time2(
-       struct tm *     tmp,
-       bool *          okayp,
-       int             usezn
-       )
-{
-       register int                    dir;
-       register int                    bits;
-       register int                    i;
-       register int                    saved_seconds;
-       time_t                          t;
-       struct tm                       yourtm, mytm;
-
-       *okayp = false;
-       yourtm = *tmp;
-       if (yourtm.tm_sec >= SECSPERMIN + 2 || yourtm.tm_sec < 0)
-               normalize(&yourtm.tm_min, &yourtm.tm_sec, SECSPERMIN);
-       normalize(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR);
-       normalize(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY);
-       normalize(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR);
-       while (yourtm.tm_mday <= 0) {
-               --yourtm.tm_year;
-               yourtm.tm_mday +=
-                       year_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)];
-       }
-       for ( ; ; ) {
-               i = mon_lengths[isleap(yourtm.tm_year +
-                       TM_YEAR_BASE)][yourtm.tm_mon];
-               if (yourtm.tm_mday <= i)
-                       break;
-               yourtm.tm_mday -= i;
-               if (++yourtm.tm_mon >= MONSPERYEAR) {
-                       yourtm.tm_mon = 0;
-                       ++yourtm.tm_year;
-               }
-       }
-       saved_seconds = yourtm.tm_sec;
-       yourtm.tm_sec = 0;
-       /*
-       ** Calculate the number of magnitude bits in a time_t
-       ** (this works regardless of whether time_t is
-       ** signed or unsigned, though lint complains if unsigned).
-       */
-       for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
-               ;
-       /*
-       ** If time_t is signed, then 0 is the median value,
-       ** if time_t is unsigned, then 1 << bits is median.
-       */
-       t = (t < 0) ? 0 : ((time_t) 1 << bits);
-       for ( ; ; ) {
-               struct tm tmbuf;
-               if (usezn)
-                   mytm = *localtime_r(&t, &tmbuf);
-               else
-                   mytm = *gmtime_r(&t, &tmbuf);
-               dir = tmcomp(&mytm, &yourtm);
-               if (dir != 0) {
-                       if (bits-- < 0)
-                               return WRONG;
-                       if (bits < 0)
-                               --t;
-                       else if (dir > 0)
-                               t -= (time_t) 1 << bits;
-                       else    t += (time_t) 1 << bits;
-                       continue;
-               }
-               if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst)
-                       break;
-
-               return WRONG;
-       }
-       t += saved_seconds;
-       if (usezn)
-           *tmp = *localtime_r(&t, &tmbuf);
-       else
-           *tmp = *gmtime_r(&t, &tmbuf);
-       *okayp = true;
-       return t;
-}
-#else
-int mktime_bs;
-#endif /* !HAVE_TIMEGM */
-
-#ifdef __UNUSED__
-static time_t
-time1(
-       struct tm * tmp
-       )
-{
-       register time_t                 t;
-       bool                            okay;
-
-       if (tmp->tm_isdst > 1)
-               tmp->tm_isdst = 1;
-       t = time2(tmp, &okay, 1);
-       if (okay || tmp->tm_isdst < 0)
-               return t;
-
-       return WRONG;
-}
-
-time_t
-mktime(
-       struct tm * tmp
-       )
-{
-       return time1(tmp);
-}
-#endif /* __UNUSED__ */
-
-#ifndef HAVE_TIMEGM
-time_t
-timegm(
-       struct tm * tmp
-       )
-{
-       register time_t                 t;
-       int                             okay;
-
-       tmp->tm_isdst = 0;
-       t = time2(tmp, &okay, 0);
-       if (okay || tmp->tm_isdst < 0)
-               return t;
-
-       return WRONG;
-}
-#endif /* !HAVE_TIMEGM */
</span></code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-2'>
<strong>
libntp/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/wscript
</span><span style="color: #aaaaaa">@@ -23,7 +23,6 @@ def build(ctx):
</span>           "iosignal.c",
                "lib_strbuf.c",
                "machines.c",
<span style="color: #000000;background-color: #ffdddd">-                "mktime.c",
</span>           "modetoa.c",
                "mstolfp.c",
                "msyslog.c",
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-3'>
<strong>
ntpd/keyword-gen.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/keyword-gen.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/keyword-gen.c
</span><span style="color: #aaaaaa">@@ -9,9 +9,6 @@
</span> #include <stdlib.h>
 #include <time.h>
 
<span style="color: #000000;background-color: #ffdddd">-#include <ntp_stdlib.h>
-#include <ntp_config.h>
-#include <lib_strbuf.h>
</span> #include "ntp_scanner.h"
 #include "ntp_parser.tab.h"
 
<span style="color: #aaaaaa">@@ -272,8 +269,6 @@ int main(int argc, char **argv)
</span>           fprintf(stderr, "Usage:\n%s t_header.h\n", argv[0]);
                exit(1);
        }
<span style="color: #000000;background-color: #ffdddd">-        debug = true;
-       init_lib();
</span> 
        populate_symb(argv[1]);
 
<span style="color: #aaaaaa">@@ -710,7 +705,7 @@ populate_symb(
</span>               && 'T' == name[0] && '_' == name[1] && token >= 0
                    && token < (int)COUNTOF(symb)) {
 
<span style="color: #000000;background-color: #ffdddd">-                        symb[token] = estrdup(name);
</span><span style="color: #000000;background-color: #ddffdd">+                   symb[token] = strdup(name);
</span>                   if (strlen(name) > MAX_TOK_LEN) {
                                fprintf(stderr,
                                        "MAX_TOK_LEN %d too small for '%s'\n"
<span style="color: #aaaaaa">@@ -728,13 +723,14 @@ symbname(
</span>   u_short token
        )
 {
<span style="color: #000000;background-color: #ddffdd">+#define BUFLENGTH 20
</span>   char *name;
 
        if (token < COUNTOF(symb) && symb[token] != NULL) {
                name = symb[token];
        } else {
<span style="color: #000000;background-color: #ffdddd">-                LIB_GETBUF(name);
-               snprintf(name, LIB_BUFLENGTH, "%d", token);
</span><span style="color: #000000;background-color: #ddffdd">+           name = malloc(BUFLENGTH);
+               snprintf(name, BUFLENGTH, "%d", token);
</span>   }       
 
        return name;
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-4'>
<strong>
ntpd/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/wscript
</span><span style="color: #aaaaaa">@@ -27,8 +27,8 @@ def build(ctx):
</span>           target      = "keyword-gen",
                features    = "c cprogram bld_include src_include libisc_include",
 # src_include libisc_include",
<span style="color: #000000;background-color: #ffdddd">-        source      = keyword_gen_source,
-               use                     = "ntp isc RT THR PTHREAD",
</span><span style="color: #000000;background-color: #ddffdd">+           source      = keyword_gen_source,
+#              use                     = "ntp isc RT THR PTHREAD",
</span>           includes    = [
                                                "%s/ntpd/" % bldnode
                ],
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f#diff-5'>
<strong>
pylib/configure.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/configure.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/configure.py
</span><span style="color: #aaaaaa">@@ -253,7 +253,6 @@ def cmd_configure(ctx):
</span>           ('strlcpy', ["string.h"]),
                ('strlcat', ["string.h"]),
 #HGM           ('sysconf', ["unistd.h"]),
<span style="color: #000000;background-color: #ffdddd">-                ('timegm', ["time.h"]),
</span>           ('timer_create', ["time.h"]),
                ('updwtmpx', ["utmpx.h"]),            # glibc
                )
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/d5bee3937a51991441b6a18ce31724e1b269ba77...5549b6a2c90ae5992b9956be18be1201d8f9bb7f">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.

</p>
</div>
</body>
</html>