[Git][NTPsec/ntpsec][master] Cut verbosity by changing where capture mode is set.
Eric S. Raymond
gitlab at mg.gitlab.com
Wed Dec 9 22:43:05 UTC 2015
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
a80eb558 by Eric S. Raymond at 2015-12-09T17:42:14Z
Cut verbosity by changing where capture mode is set.
- - - - -
3 changed files:
- ntpd/ntp_config.c
- ntpd/ntp_intercept.c
- ntpd/ntpd.c
Changes:
=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -2430,8 +2430,9 @@ config_access(
? "source"
: "default";
const char *kod_warn = "KOD does nothing without LIMITED.";
-
- fprintf(stderr, "restrict %s: %s\n", kod_where, kod_warn);
+ /* FIXME: should probly just drop this */
+ if (intercept_get_mode() == none)
+ fprintf(stderr, "restrict %s: %s\n", kod_where, kod_warn);
msyslog(LOG_WARNING, "restrict %s: %s", kod_where, kod_warn);
}
=====================================
ntpd/ntp_intercept.c
=====================================
--- a/ntpd/ntp_intercept.c
+++ b/ntpd/ntp_intercept.c
@@ -123,27 +123,17 @@ void intercept_set_mode(intercept_mode newmode)
{
mode = newmode;
if (mode != none) {
- if (mode == replay)
- fputs("# Setting replay mode\n", stdout);
- else if (mode == capture)
- fputs("# Setting capture mode\n", stdout);
syslogit = false;
- //hashprefix = termlogit = true;
- termlogit = false;
+ hashprefix = true;
+ termlogit = (debug > 0);
}
}
void intercept_argparse(int *argc, char ***argv)
{
- int i;
- for (i = 1; i < *argc; i++)
- if (strcmp((*argv)[i], "-y") == 0)
- intercept_set_mode(capture);
- else if (strcmp((*argv)[i], "-Y") == 0)
- intercept_set_mode(replay);
-
if (mode == capture)
{
+ int i;
printf("event startup");
for (i = 1; i < *argc; i++)
if (strcmp((*argv)[i], "-y") != 0 && strcmp((*argv)[i], "-Y") != 0)
=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -375,10 +375,10 @@ parse_cmdline_opts(
/* defer */
break;
case 'y':
- /* processed by interception code */
+ intercept_set_mode(capture);
break;
case 'Y':
- /* processed by interception code */
+ intercept_set_mode(replay);
break;
case 'z':
/* defer */
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a80eb558fad7046b482430ef6c5601c323cd0f92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151209/c6f52983/attachment.html>
More information about the vc
mailing list