diff --git a/usr.sbin/timed/timed/master.c b/usr.sbin/timed/timed/master.c index e36fbaef915a..053701660f69 100644 --- a/usr.sbin/timed/timed/master.c +++ b/usr.sbin/timed/timed/master.c @@ -44,6 +44,7 @@ static const char rcsid[] = #include #include #include +#include #include "pathnames.h" extern int measure_delta; @@ -56,8 +57,6 @@ static int slvcount; /* slaves listening to our clock */ static void mchgdate(struct tsp *); -extern void logwtmp(char *, char *, char *); - /* * The main function of `master' is to periodically compute the differences * (deltas) between its clock and the clocks of the slaves, to compute the @@ -350,6 +349,7 @@ mchgdate(msg) char tname[MAXHOSTNAMELEN]; char olddate[32]; struct timeval otime, ntime, tmptv; + struct utmpx utx; (void)strcpy(tname, msg->tsp_name); @@ -371,9 +371,13 @@ mchgdate(msg) dictate = 3; synch(tvtomsround(ntime)); } else { - logwtmp("|", "date", ""); + utx.ut_type = OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); (void)settimeofday(&tmptv, 0); - logwtmp("{", "date", ""); + utx.ut_type = NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); spreadtime(); } diff --git a/usr.sbin/timed/timed/slave.c b/usr.sbin/timed/timed/slave.c index 217fd8225da0..74a17234549e 100644 --- a/usr.sbin/timed/timed/slave.c +++ b/usr.sbin/timed/timed/slave.c @@ -41,6 +41,7 @@ static const char rcsid[] = #include "globals.h" #include +#include #include "pathnames.h" extern jmp_buf jmpenv; @@ -57,8 +58,6 @@ static void schgdate(struct tsp *, char *); static void setmaster(struct tsp *); static void answerdelay(void); -extern void logwtmp(char *, char *, char *); - int slave() { @@ -80,6 +79,7 @@ slave() char newdate[32]; struct netinfo *ntp; struct hosttbl *htp; + struct utmpx utx; old_slavenet = 0; @@ -280,9 +280,13 @@ loop: */ synch(tvtomsround(ntime)); } else { - logwtmp("|", "date", ""); - (void)settimeofday(&tmptv, 0); - logwtmp("{", "date", ""); + utx.ut_type = OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); + (void)settimeofday(&tmptv, 0); + utx.ut_type = NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); syslog(LOG_NOTICE, "date changed by %s from %s", msg->tsp_name, olddate);