From: Harlan Stenn Date: Sat, 18 Jan 2020 09:46:30 +0000 (-0500) Subject: [Bug 3637] Emit the version of ntpd in saveconfig X-Git-Tag: NTP_4_2_8P13~17^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b931058571a8be94923e70925bd61adcd23851d9;p=thirdparty%2Fntp.git [Bug 3637] Emit the version of ntpd in saveconfig bk: 5e22d3f6E9erByGi6L0E15tGoOJeWQ --- diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index 60c5de8a1..da2ffd04b 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -414,7 +414,8 @@ $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(PROGRAMS): $(LDADD) compsave.conf: ntpd complete.conf - ./ntpd --configfile complete.conf --saveconfigquit $@ + ./ntpd --configfile complete.conf --saveconfigquit $@+ + grep -v '^#' $@+ > $@ check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 6022f9af2..589295676 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -29,6 +29,7 @@ #ifdef HAVE_SYS_WAIT_H # include #endif +#include #include #include @@ -500,11 +501,11 @@ dump_all_config_trees( { config_tree * cfg_ptr; int return_value; - time_t now = time(NULL) + time_t now = time(NULL); struct tm tm = *localtime(&now); fprintf(df, "#NTF:D %04d%02d%02d@%02d:%02d:%02d\n", - tm.tm.tm_year+1900, tm.tm_mon+1, tm.tm_day, + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); fprintf(df, "#NTF:V %s\n", Version);