diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-07 01:25:31 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-07 01:25:31 +0000 |
commit | 9b7b9d79985d14e71511876b0d6c652c129275f6 (patch) | |
tree | 4bfd9c39700142baabe3040a941f9fecf7507870 /sbin | |
parent | d675ca18780345909715e96f8a3e77e6d8ae5596 (diff) |
I never committed the fix for PR 3296, "Dump prints negative numbers for time"
Here it is...
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dump/optr.c | 14 | ||||
-rw-r--r-- | sbin/dump/tape.c | 9 |
2 files changed, 9 insertions, 14 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 9e63d2b1583..ba9cb2f80f3 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: optr.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $ */ +/* $OpenBSD: optr.c,v 1.25 2003/07/07 01:25:30 millert Exp $ */ /* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #else -static char rcsid[] = "$OpenBSD: optr.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: optr.c,v 1.25 2003/07/07 01:25:30 millert Exp $"; #endif #endif /* not lint */ @@ -82,7 +82,7 @@ query(char *question) FILE *mytty; time_t firstprompt, when_answered; - firstprompt = time(NULL); + (void) time(&firstprompt); if ((mytty = fopen(_PATH_TTY, "r")) == NULL) quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno)); @@ -115,14 +115,14 @@ query(char *question) if (signal(SIGALRM, sig) == SIG_IGN) signal(SIGALRM, SIG_IGN); (void) fclose(mytty); - when_answered = time(NULL); + (void) time(&when_answered); /* * Adjust the base for time estimates to ignore time we spent waiting * for operator input. */ - if (tstart_writing != 0) - tstart_writing += (when_answered - firstprompt); - return(back); + if (when_answered - firstprompt > 0) + tstart_writing += (when_answered - firstprompt); + return (back); } char lastmsg[BUFSIZ]; diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index 110a1d80cf9..50e30768c75 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tape.c,v 1.17 2003/06/26 16:35:21 deraadt Exp $ */ +/* $OpenBSD: tape.c,v 1.18 2003/07/07 01:25:30 millert Exp $ */ /* $NetBSD: tape.c,v 1.11 1997/06/05 11:13:26 lukem Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tape.c 8.2 (Berkeley) 3/17/94"; #else -static char rcsid[] = "$OpenBSD: tape.c,v 1.17 2003/06/26 16:35:21 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tape.c,v 1.18 2003/07/07 01:25:30 millert Exp $"; #endif #endif /* not lint */ @@ -415,13 +415,10 @@ trewind(void) void close_rewind(void) { - time_t tstart_changevol, tend_changevol; - trewind(); (void)do_stats(); if (nexttape) return; - time(&tstart_changevol); if (!nogripe) { msg("Change Volumes: Mount volume #%d\n", tapeno+1); broadcast("CHANGE DUMP VOLUMES!\7\7\n"); @@ -431,8 +428,6 @@ close_rewind(void) dumpabort(0); /*NOTREACHED*/ } - time(&tend_changevol); - tstart_writing += (tend_changevol - tstart_changevol); } void |