typeof(timeval.ts_sec) != time_t
This commit is contained in:
parent
dcb82cbdbc
commit
8936958f57
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: print.c,v 1.23 1995/05/25 04:13:17 mycroft Exp $ */
|
||||
/* $NetBSD: print.c,v 1.24 1995/06/07 16:29:30 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#else
|
||||
static char rcsid[] = "$NetBSD: print.c,v 1.23 1995/05/25 04:13:17 mycroft Exp $";
|
||||
static char rcsid[] = "$NetBSD: print.c,v 1.24 1995/06/07 16:29:30 cgd Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -381,6 +381,7 @@ started(k, ve)
|
||||
{
|
||||
VAR *v;
|
||||
static time_t now;
|
||||
time_t startt;
|
||||
struct tm *tp;
|
||||
char buf[100];
|
||||
|
||||
@ -390,7 +391,8 @@ started(k, ve)
|
||||
return;
|
||||
}
|
||||
|
||||
tp = localtime(&k->ki_u.u_start.tv_sec);
|
||||
startt = k->ki_u.u_start.tv_sec;
|
||||
tp = localtime(&startt);
|
||||
if (!now)
|
||||
(void)time(&now);
|
||||
if (now - k->ki_u.u_start.tv_sec < 24 * SECSPERHOUR) {
|
||||
@ -412,6 +414,7 @@ lstarted(k, ve)
|
||||
VARENT *ve;
|
||||
{
|
||||
VAR *v;
|
||||
time_t startt;
|
||||
char buf[100];
|
||||
|
||||
v = ve->var;
|
||||
@ -419,8 +422,9 @@ lstarted(k, ve)
|
||||
(void)printf("%-*s", v->width, "-");
|
||||
return;
|
||||
}
|
||||
startt = k->ki_u.u_start.tv_sec;
|
||||
(void)strftime(buf, sizeof(buf) -1, "%C",
|
||||
localtime(&k->ki_u.u_start.tv_sec));
|
||||
localtime(&startt));
|
||||
(void)printf("%-*s", v->width, buf);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $ */
|
||||
/* $NetBSD: pom.c,v 1.5 1995/06/07 16:30:46 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -45,7 +45,7 @@ static char copyright[] =
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static char rcsid[] = "$NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $";
|
||||
static char rcsid[] = "$NetBSD: pom.c,v 1.5 1995/06/07 16:30:46 cgd Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -82,6 +82,7 @@ main()
|
||||
struct timeval tp;
|
||||
struct timezone tzp;
|
||||
struct tm *GMT, *gmtime();
|
||||
time_t tmpt;
|
||||
double days, today, tomorrow;
|
||||
int cnt;
|
||||
|
||||
@ -89,7 +90,8 @@ main()
|
||||
(void)fprintf(stderr, "pom: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
GMT = gmtime(&tp.tv_sec);
|
||||
tmpt = tp.tv_sec;
|
||||
GMT = gmtime(&tmpt);
|
||||
days = (GMT->tm_yday + 1) + ((GMT->tm_hour +
|
||||
(GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0);
|
||||
for (cnt = EPOCH; cnt < GMT->tm_year; ++cnt)
|
||||
|
Loading…
Reference in New Issue
Block a user