Module Name: src Committed By: christos Date: Fri Apr 2 21:33:14 UTC 2010
Modified Files: src/dist/ntp/ntpdate: ntptimeset.c Log Message: check ctime return To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/dist/ntp/ntpdate/ntptimeset.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/dist/ntp/ntpdate/ntptimeset.c diff -u src/dist/ntp/ntpdate/ntptimeset.c:1.5 src/dist/ntp/ntpdate/ntptimeset.c:1.6 --- src/dist/ntp/ntpdate/ntptimeset.c:1.5 Sun Jun 11 15:34:21 2006 +++ src/dist/ntp/ntpdate/ntptimeset.c Fri Apr 2 17:33:14 2010 @@ -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),