<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>Eric S. Raymond 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/2597e4a89ad03fd40ab98b46517000847d69708a">2597e4a8</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-11-24T13:22:41Z</i>
</div>
<pre class='commit-message'>msyslog_term -> termlogit, msyslog_term_pid -> termlogit_pid.

No logic changes. The point of this commit is to make the next one, which will
change the way logging is controlled, easier to read.</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/92ecea22056735e1b962793368966e2286249f3b">92ecea22</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-11-24T13:22:41Z</i>
</div>
<pre class='commit-message'>This enable us to make three minor functional changes:

(1) waf check -v no longer spams log messages to stdout (Gitlab issue #19).

(2) ntpdig now suppresses logging to stdout (long-time to-do from Hal Murray).

(3) The (not yet working) TESTFRAME modes wuill fully suppress logging.</pre>
</li>
</ul>
<h4>10 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/ntp_syslog.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
libntp/emalloc.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
libntp/intercept.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
libntp/msyslog.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
ntpd/ntp_proto.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
ntpd/ntpd.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
ntpd/ntpsim.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
ntpdig/log.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
ntpdig/main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
tests/common/tests_main.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-0'>
<strong>
include/ntp_syslog.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntp_syslog.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntp_syslog.h
</span><span style="color: #aaaaaa">@@ -10,9 +10,9 @@
</span> 
 #include "ntp_types.h"               /* uint32_t type */
 
<span style="color: #000000;background-color: #ffdddd">-extern bool     syslogit;
-extern bool    msyslog_term;   /* duplicate to stdout/err */
-extern bool    msyslog_term_pid;
</span><span style="color: #000000;background-color: #ddffdd">+extern bool        syslogit;       /* log to syslogit */
+extern bool    termlogit;      /* duplicate to stdout/err */
+extern bool    termlogit_pid;
</span> extern bool       msyslog_include_timestamp;
 extern FILE *  syslog_file;    /* if syslogit is false, log to
                                   this file and not syslog */
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-1'>
<strong>
libntp/emalloc.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/emalloc.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/emalloc.c
</span><span style="color: #aaaaaa">@@ -42,7 +42,7 @@ ereallocz(
</span> 
        mem = EREALLOC_IMPL(ptr, allocsz, file, line);
        if (NULL == mem) {
<span style="color: #000000;background-color: #ffdddd">-                msyslog_term = true;
</span><span style="color: #000000;background-color: #ddffdd">+           termlogit = true;
</span> #ifndef EREALLOC_CALLSITE
                msyslog(LOG_ERR, "fatal out of memory (%lu bytes)",
                        (u_long)newsz);
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-2'>
<strong>
libntp/intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/intercept.c
</span><span style="color: #aaaaaa">@@ -110,7 +110,7 @@ void intercept_set_mode(intercept_mode newmode)
</span> {
     mode = newmode;
     if (newmode == replay)
<span style="color: #000000;background-color: #ffdddd">-        syslogit = false;
</span><span style="color: #000000;background-color: #ddffdd">+   termlogit = syslogit = false;
</span> }
 
 void intercept_argparse(int *argc, char ***argv)
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-3'>
<strong>
libntp/msyslog.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/msyslog.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/msyslog.c
</span><span style="color: #aaaaaa">@@ -22,9 +22,9 @@
</span> #endif
 
 
<span style="color: #000000;background-color: #ffdddd">-bool    syslogit = true;
-bool   msyslog_term = false;   /* duplicate to stdout/err */
-bool   msyslog_term_pid = true;
</span><span style="color: #000000;background-color: #ddffdd">+bool       syslogit = true;        /* log messages to syslog */
+bool   termlogit = false;      /* duplicate to stdout/err */
+bool   termlogit_pid = true;
</span> bool      msyslog_include_timestamp = true;
 FILE * syslog_file;
 char * syslog_fname;
<span style="color: #aaaaaa">@@ -142,15 +142,13 @@ addto_syslog(
</span>                   prog = progname;
        }
 
<span style="color: #000000;background-color: #ffdddd">-        log_to_term = msyslog_term;
</span><span style="color: #000000;background-color: #ddffdd">+   log_to_term = termlogit;
</span>   log_to_file = false;
        if (syslogit)
                syslog(level, "%s", msg);
        else
                if (syslog_file != NULL)
                        log_to_file = true;
<span style="color: #000000;background-color: #ffdddd">-                else
-                       log_to_term = true;
</span> #if DEBUG
        if (debug > 0)
                log_to_term = true;
<span style="color: #aaaaaa">@@ -163,7 +161,7 @@ addto_syslog(
</span>           human_time = humanlogtime();
        else    /* suppress gcc pot. uninit. warning */
                human_time = NULL;
<span style="color: #000000;background-color: #ffdddd">-        if (msyslog_term_pid || log_to_file)
</span><span style="color: #000000;background-color: #ddffdd">+   if (termlogit_pid || log_to_file)
</span>           pid = getpid();
        else    /* suppress gcc pot. uninit. warning */
                pid = -1;
<span style="color: #aaaaaa">@@ -180,7 +178,7 @@ addto_syslog(
</span>                           : stdout;
                if (msyslog_include_timestamp)
                        fprintf(term_file, "%s ", human_time);
<span style="color: #000000;background-color: #ffdddd">-                if (msyslog_term_pid)
</span><span style="color: #000000;background-color: #ddffdd">+           if (termlogit_pid)
</span>                   fprintf(term_file, "%s[%d]: ", prog, pid);
                fprintf(term_file, "%s%s", msg, nl_or_empty);
                fflush(term_file);
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-4'>
<strong>
ntpd/ntp_proto.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_proto.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_proto.c
</span><span style="color: #aaaaaa">@@ -355,7 +355,7 @@ transmit(
</span>                           if (peer_ntpdate == 0) {
                                        msyslog(LOG_NOTICE,
                                            "ntpd: no servers found");
<span style="color: #000000;background-color: #ffdddd">-                                        if (!msyslog_term)
</span><span style="color: #000000;background-color: #ddffdd">+                                   if (!termlogit)
</span>                                           printf(
                                                    "ntpd: no servers found\n");
                                        exit (0);
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-5'>
<strong>
ntpd/ntpd.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntpd.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntpd.c
</span><span style="color: #aaaaaa">@@ -580,10 +580,11 @@ ntpdmain(
</span>   /* honor -l/--logfile option to log to a file */
        if (logfilename != NULL) {
                syslogit = false;
<span style="color: #000000;background-color: #ddffdd">+                termlogit = false;
</span>           change_logfile(logfilename, false);
        } else {
                if (nofork)
<span style="color: #000000;background-color: #ffdddd">-                        msyslog_term = true;
</span><span style="color: #000000;background-color: #ddffdd">+                   termlogit = true;
</span>           if (saveconfigquit || dumpopts)
                        syslogit = false;
        }
<span style="color: #aaaaaa">@@ -618,7 +619,7 @@ ntpdmain(
</span> 
        uid = getuid();
        if (uid && !saveconfigquit && !dumpopts) {
<span style="color: #000000;background-color: #ffdddd">-                msyslog_term = true;
</span><span style="color: #000000;background-color: #ddffdd">+           termlogit = true;
</span>           msyslog(LOG_ERR,
                        "must be run as root, not uid %ld", (long)uid);
                exit(1);
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-6'>
<strong>
ntpd/ntpsim.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntpsim.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntpsim.c
</span><span style="color: #aaaaaa">@@ -120,7 +120,7 @@ ntpsim(
</span> 
        /* Initialize ntp modules */
        initializing = true;
<span style="color: #000000;background-color: #ffdddd">-        msyslog_term = true;
</span><span style="color: #000000;background-color: #ddffdd">+   termlogit = true;
</span>   init_sim_io();
        init_auth();
        init_util();
</code></pre>

<br>
</li>
<li id='diff-7'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-7'>
<strong>
ntpdig/log.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpdig/log.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpdig/log.c
</span><span style="color: #aaaaaa">@@ -11,9 +11,9 @@ ntpdig_init_logging(
</span>   const char *prog
        )
 {
<span style="color: #000000;background-color: #ffdddd">-        msyslog_term = true;
</span><span style="color: #000000;background-color: #ddffdd">+   termlogit = false;
</span>   init_logging(prog, 0, false);
<span style="color: #000000;background-color: #ffdddd">-        msyslog_term_pid = false;
</span><span style="color: #000000;background-color: #ddffdd">+   termlogit_pid = false;
</span>   msyslog_include_timestamp = false;
 }
 
</code></pre>

<br>
</li>
<li id='diff-8'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-8'>
<strong>
ntpdig/main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpdig/main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpdig/main.c
</span><span style="color: #aaaaaa">@@ -1375,12 +1375,17 @@ handle_pkt(
</span>                      leaptxt,
                           time_adjusted ? "true" : "false");
                }
<span style="color: #000000;background-color: #ffdddd">-                else
-                   msyslog(LOG_INFO, "%s %+.*f%s %s s%d %s%s", ts_str,
</span><span style="color: #000000;background-color: #ddffdd">+           else {
+                   char msgbuf[132];
+                   snprintf(msgbuf, sizeof(msgbuf),
+                           "%s %+.*f%s %s s%d %s%s", ts_str,
</span>                       digits, offset, disptxt,
                            hostnameaddr(hostname, host), stratum,
                            leaptxt,
                            time_adjusted ? " [excess]" : "");
<span style="color: #000000;background-color: #ddffdd">+                    printf("%s\n", msgbuf);
+                   msyslog(LOG_INFO, "%s", msgbuf);
+               }
</span>           free(ts_str);
 
                if (p_NTPDIG_PRETEND_TIME)
</code></pre>

<br>
</li>
<li id='diff-9'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b#diff-9'>
<strong>
tests/common/tests_main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/common/tests_main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/common/tests_main.c
</span><span style="color: #aaaaaa">@@ -25,6 +25,7 @@ const char* tests_main_args(int arg)
</span> static void RunAllTests(void)
 {
        syslogit = false;
<span style="color: #000000;background-color: #ddffdd">+        termlogit = false;
</span> 
 #ifdef TEST_NTPDIG
        RUN_TEST_GROUP(crypto);
</code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b">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.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://gitlab.com/NTPsec/ntpsec/compare/425d2481f803e5e5ba6a3ca0fe1555b83ec2bd91...92ecea22056735e1b962793368966e2286249f3b"}}</script>
</p>
</div>
</body>
</html>