From owner-freebsd-bugs Tue Nov 20 11:30: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CFDDD37B41B for ; Tue, 20 Nov 2001 11:30:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fAKJU2K90640; Tue, 20 Nov 2001 11:30:02 -0800 (PST) (envelope-from gnats) Date: Tue, 20 Nov 2001 11:30:02 -0800 (PST) Message-Id: <200111201930.fAKJU2K90640@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ian Dowse Subject: Re: bin/32138: better progress reporting for dump(8) Reply-To: Ian Dowse Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/32138; it has been noted by GNATS. From: Ian Dowse To: Mikhail Teterin Cc: arr@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/32138: better progress reporting for dump(8) Date: Tue, 20 Nov 2001 19:29:46 +0000 In message <200111201907.fAKJ7bO40025@aldan.algebra.com>, Mikhail Teterin write s: >How about this: Much better! Two comments: >+void >+infosch(int signal) { >+ /* >+ * 300 seconds -- 5 minutes -- is the magical constant, >+ * only used in this file >+ */ >+ if (tschedule > 300) >+ tschedule -= 300; >+} If "tschedule = 0" will work here instead, then I'd suggest using that to avoid the magic constant. >+ * A side effect of this function, is it replaces the final '\n' (if any) >+ * with the '\0' in the global variable lastmsg -- to avoid the literal >+ * "\n" being put into the proctitle. >+ * So, if the lastmsg needs to be output elsewhere, that should happen >+ * before calling title(). You can avoid this side-effect by telling setproctitle not to print the last character, i.e: lastlen = strlen(lastmsg); if (lastlen > 0 && lastmsg[lastlen - 1] == '\n') lastlen--; setproctitle("%s: %.*s", disk, lastlen, lastmsg); Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message