Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/ntp/ntpdate check ctime return



details:   https://anonhg.NetBSD.org/src/rev/dff36748f360
branches:  trunk
changeset: 753591:dff36748f360
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 02 21:33:14 2010 +0000

description:
check ctime return

diffstat:

 dist/ntp/ntpdate/ntptimeset.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r cf6920535cf4 -r dff36748f360 dist/ntp/ntpdate/ntptimeset.c
--- a/dist/ntp/ntpdate/ntptimeset.c     Fri Apr 02 21:29:30 2010 +0000
+++ b/dist/ntp/ntpdate/ntptimeset.c     Fri Apr 02 21:33:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntptimeset.c,v 1.5 2006/06/11 19:34:21 kardel Exp $    */
+/*     $NetBSD: ntptimeset.c,v 1.6 2010/04/02 21:33:14 christos Exp $  */
 
 /*
  * ntptimeset - get/set the time via ntp
@@ -1505,6 +1505,7 @@
        register struct server *server;
        time_t tmp;
        double dtemp;
+       const char *p;
 
        /*
         * if setting time then print final analysis
@@ -1566,6 +1567,8 @@
        LFPTOD(&server->offset, dtemp);
        step_systime(dtemp);
        time(&tmp);
+       if ((p = ctime(&tmp)) == NULL)
+               p = "?";
        fprintf(stdout,"Time set to %.20s [%s %s %ld/%ld]\n",
                ctime(&tmp)+4,
                ntoa(&server->srcadr),



Home | Main Index | Thread Index | Old Index