NetBSD Problem Report #900
From gnats Thu Mar 23 20:14:30 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id UAA06290 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 23 Mar 1995 20:13:01 -0800
Message-Id: <199503240353.WAA00769@kolvir.blrc.ma.us>
Date: Thu, 23 Mar 1995 22:53:51 -0500
From: John Kohl <jtk@kolvir.blrc.ma.us>
Reply-To: jtk@kolvir.blrc.ma.us
To: gnats-bugs@NetBSD.ORG
Cc: peter@mnti.com
Subject: dump estimates time poorly when waiting for user interaction
X-Send-Pr-Version: 3.2
>Number: 900
>Category: bin
>Synopsis: dump includes time waiting for operator in speed estimates
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Mar 23 20:20:03 +0000 1995
>Closed-Date: Sat May 18 16:16:37 +0000 1996
>Last-Modified: Sat May 18 16:17:08 +0000 1996
>Originator: John Kohl
>Release: NetBSD/i386 current, as of 1995/03/20
>Organization:
NetBSD Kernel Hackers `R` Us
>Environment:
System: NetBSD kolvir 1.0A NetBSD 1.0A (KOLVIR) #145: Wed Mar 22 19:42:17 EST 1995 jtk@kolvir:/u1/NetBSD-current/src/sys/arch/i386/compile/KOLVIR i386
>Description:
Dump estimates time remaining to do its work. These estimates are based
on the amount of time elapsed since it wrote the first block. This
estimate will be inflated if the dump is waiting for operator input at a
volume change.
>How-To-Repeat:
Run dump onto small tapes, let it sit waiting for a tape change for a
long time, and then see the remaining time estimate be vastly
overinflated.
>Fix:
--- 1.1 1995/03/24 03:45:19
+++ src/sbin/dump/optr.c 1995/03/24 03:50:25
@@ -87,6 +87,9 @@
char replybuffer[64];
int back, errcount;
FILE *mytty;
+ time_t firstprompt, when_answered;
+
+ firstprompt = time((time_t *)0);
if ((mytty = fopen(_PATH_TTY, "r")) == NULL)
quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno));
@@ -119,6 +122,13 @@
if (signal(SIGALRM, sig) == SIG_IGN)
signal(SIGALRM, SIG_IGN);
(void) fclose(mytty);
+ when_answered = time((time_t *)0);
+ /*
+ * 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);
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: jtk
State-Changed-When: Sat May 18 12:16:37 EDT 1996
State-Changed-Why:
applied patches
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.