summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-06-07 17:40:51 +0000
committercgd <cgd@NetBSD.org>1995-06-07 17:40:51 +0000
commit29d4fed17fbd4f48c120ee83700e02eefea2b95b (patch)
treee00515cf03c8982844610e18be2e9461064d71a0
parent10603feb5101fb1c049ac106f1e959b2fbe4bee8 (diff)
typeof(timeval.tv_sec) != time_t
-rw-r--r--usr.sbin/named/db_dump.c10
-rw-r--r--usr.sbin/named/ns_maint.c10
-rw-r--r--usr.sbin/sysctl/sysctl.c11
-rw-r--r--usr.sbin/timed/timed/master.c9
-rw-r--r--usr.sbin/timed/timed/readmsg.c7
-rw-r--r--usr.sbin/timed/timed/slave.c12
-rw-r--r--usr.sbin/timed/timed/timed.c6
7 files changed, 43 insertions, 22 deletions
diff --git a/usr.sbin/named/db_dump.c b/usr.sbin/named/db_dump.c
index c5b273d2a05..b42178f94de 100644
--- a/usr.sbin/named/db_dump.c
+++ b/usr.sbin/named/db_dump.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)db_dump.c 4.33 (Berkeley) 3/3/91";*/
-static char rcsid[] = "$Id: db_dump.c,v 1.2 1993/08/01 17:57:34 mycroft Exp $";
+static char rcsid[] = "$Id: db_dump.c,v 1.3 1995/06/07 17:40:51 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -70,6 +70,7 @@ doachkpt()
{
extern int errno;
FILE *fp;
+ time_t dumptime;
char tmpcheckfile[256];
/* nowhere to checkpoint cache... */
@@ -96,7 +97,8 @@ doachkpt()
}
(void) gettime(&tt);
- fprintf(fp, "; Dumped at %s", ctime(&tt.tv_sec));
+ dumptime = tt.tv_sec;
+ fprintf(fp, "; Dumped at %s", ctime(&dumptime));
fflush(fp);
if (ferror(fp)) {
#ifdef DEBUG
@@ -240,6 +242,7 @@ mark_cache(htp, ttl)
doadump()
{
FILE *fp;
+ time_t dumptime;
#ifdef DEBUG
if (debug >= 3)
@@ -249,7 +252,8 @@ doadump()
if ((fp = fopen(dumpfile, "w")) == NULL)
return;
gettime(&tt);
- fprintf(fp, "; Dumped at %s", ctime(&tt.tv_sec));
+ dumptime = tt.tv_sec;
+ fprintf(fp, "; Dumped at %s", ctime(&dumptime));
fprintf(fp, "; --- Cache & Data ---\n");
if (hashtab != NULL)
(void) db_dump(hashtab, fp, DB_Z_ALL, "");
diff --git a/usr.sbin/named/ns_maint.c b/usr.sbin/named/ns_maint.c
index 4b595c52d96..5abc6637d8b 100644
--- a/usr.sbin/named/ns_maint.c
+++ b/usr.sbin/named/ns_maint.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)ns_maint.c 4.39 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$Id: ns_maint.c,v 1.2 1993/08/01 17:57:42 mycroft Exp $";
+static char rcsid[] = "$Id: ns_maint.c,v 1.3 1995/06/07 17:40:54 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -80,8 +80,12 @@ ns_maint()
gettime(&tt);
#ifdef DEBUG
- if (debug)
- fprintf(ddt,"\nns_maint(); now %s", ctime(&tt.tv_sec));
+ if (debug) {
+ time_t now;
+
+ now = tt.tv_sec;
+ fprintf(ddt,"\nns_maint(); now %s", ctime(&now));
+ }
#endif
xfers_deferred = 0;
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index 2915be70499..bb409a8cdbd 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: sysctl.c,v 1.6 1995/06/02 15:03:34 pk Exp $";
+static char *rcsid = "$Id: sysctl.c,v 1.7 1995/06/07 17:41:17 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -377,11 +377,12 @@ parse(string, flags)
}
if (special & BOOTTIME) {
struct timeval *btp = (struct timeval *)buf;
+ time_t boottime;
- if (!nflag)
- fprintf(stdout, "%s = %s\n", string,
- ctime(&btp->tv_sec));
- else
+ if (!nflag) {
+ boottime = btp->tv_sec;
+ fprintf(stdout, "%s = %s\n", string, ctime(&boottime));
+ } else
fprintf(stdout, "%d\n", btp->tv_sec);
return;
}
diff --git a/usr.sbin/timed/timed/master.c b/usr.sbin/timed/timed/master.c
index 905537159c5..9129df57da7 100644
--- a/usr.sbin/timed/timed/master.c
+++ b/usr.sbin/timed/timed/master.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)master.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.4 $"
+#ident "$Revision: 1.5 $"
#endif
#include "globals.h"
@@ -86,6 +86,7 @@ master()
#define POLLRATE 4
int polls;
struct timeval wait, ntime;
+ time_t tmpt;
struct tsp *msg, *answer, to;
char newdate[32];
struct sockaddr_in taddr;
@@ -182,7 +183,8 @@ loop:
#ifdef sgi
(void)cftime(newdate, "%D %T", &msg->tsp_time.tv_sec);
#else
- (void)strcpy(newdate, ctime(&msg->tsp_time.tv_sec));
+ tmpt = msg->tsp_time.tv_sec;
+ (void)strcpy(newdate, ctime(&tmpt));
#endif /* sgi */
if (!good_host_name(msg->tsp_name)) {
syslog(LOG_NOTICE,
@@ -203,7 +205,8 @@ loop:
#ifdef sgi
(void)cftime(newdate, "%D %T", &msg->tsp_time.tv_sec);
#else
- (void)strcpy(newdate, ctime(&msg->tsp_time.tv_sec));
+ tmpt = msg->tsp_time.tv_sec;
+ (void)strcpy(newdate, ctime(&tmpt));
#endif /* sgi */
htp = findhost(msg->tsp_name);
if (htp == 0) {
diff --git a/usr.sbin/timed/timed/readmsg.c b/usr.sbin/timed/timed/readmsg.c
index 80ed9037f8a..b456ba620c2 100644
--- a/usr.sbin/timed/timed/readmsg.c
+++ b/usr.sbin/timed/timed/readmsg.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)readmsg.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.4 $"
+#ident "$Revision: 1.5 $"
#endif
#include "globals.h"
@@ -432,6 +432,8 @@ struct tsp *msg;
struct sockaddr_in *addr;
{
char tm[26];
+ time_t msgtime;
+
switch (msg->tsp_type) {
case TSP_LOOP:
@@ -450,7 +452,8 @@ struct sockaddr_in *addr;
#ifdef sgi
(void)cftime(tm, "%D %T", &msg->tsp_time.tv_sec);
#else
- strncpy(tm, ctime(&msg->tsp_time.tv_sec)+3+1, sizeof(tm));
+ msgtime = msg->tsp_time.tv_sec;
+ strncpy(tm, ctime(&msgtime)+3+1, sizeof(tm));
tm[15] = '\0'; /* ugh */
#endif /* sgi */
fprintf(fd, "%s %d %-6u %s %-15s %s\n",
diff --git a/usr.sbin/timed/timed/slave.c b/usr.sbin/timed/timed/slave.c
index e10264b2a37..41926f5d479 100644
--- a/usr.sbin/timed/timed/slave.c
+++ b/usr.sbin/timed/timed/slave.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)slave.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.4 $"
+#ident "$Revision: 1.5 $"
#endif
#include "globals.h"
@@ -77,6 +77,7 @@ slave()
char tname[MAXHOSTNAMELEN];
struct tsp *msg, to;
struct timeval ntime, wait;
+ time_t tmpt;
struct tsp *answer;
int timeout();
char olddate[32];
@@ -266,7 +267,8 @@ loop:
* calling ctime() which clobbers the static buffer
*/
(void)strcpy(olddate, date());
- (void)strcpy(newdate, ctime(&msg->tsp_time.tv_sec));
+ tmpt = msg->tsp_time.tv_sec;
+ (void)strcpy(newdate, ctime(&tmpt));
#endif /* sgi */
if (!good_host_name(msg->tsp_name)) {
@@ -357,7 +359,8 @@ loop:
#ifdef sgi
(void)cftime(newdate, "%D %T", &msg->tsp_time.tv_sec);
#else
- (void)strcpy(newdate, ctime(&msg->tsp_time.tv_sec));
+ tmpt = msg->tsp_time.tv_sec;
+ (void)strcpy(newdate, ctime(&tmpt));
#endif /* sgi */
schgdate(msg, newdate);
break;
@@ -368,7 +371,8 @@ loop:
#ifdef sgi
(void)cftime(newdate, "%D %T", &msg->tsp_time.tv_sec);
#else
- (void)strcpy(newdate, ctime(&msg->tsp_time.tv_sec));
+ tmpt = msg->tsp_time.tv_sec;
+ (void)strcpy(newdate, ctime(&tmpt));
#endif /* sgi */
htp = findhost(msg->tsp_name);
if (0 == htp) {
diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c
index f540bcc686f..fe958633acf 100644
--- a/usr.sbin/timed/timed/timed.c
+++ b/usr.sbin/timed/timed/timed.c
@@ -42,7 +42,7 @@ static char sccsid[] = "@(#)timed.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.4 $"
+#ident "$Revision: 1.5 $"
#endif /* sgi */
#define TSPTYPES
@@ -833,9 +833,11 @@ date()
return (tm);
#else
struct timeval tv;
+ time_t t;
(void)gettimeofday(&tv, (struct timezone *)0);
- return (ctime(&tv.tv_sec));
+ t = tv.tv_sec;
+ return (ctime(&t));
#endif /* sgi */
}