Date: Tue, 20 Nov 2001 11:40:01 -0800 (PST) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/32138: better progress reporting for dump(8) Message-ID: <200111201940.fAKJe1p92252@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/32138; it has been noted by GNATS.
From: "Andrew R. Reiter" <arr@FreeBSD.org>
To: Ian Dowse <iedowse@maths.tcd.ie>
Cc: Mikhail Teterin <mi@aldan.algebra.com>, arr@FreeBSD.org,
FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/32138: better progress reporting for dump(8)
Date: Tue, 20 Nov 2001 14:30:20 -0500 (EST)
On Tue, 20 Nov 2001, Ian Dowse wrote:
: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
:
setproctitle() should not even be used in the handler.
--
Andrew R. Reiter
arr@watson.org
arr@FreeBSD.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111201940.fAKJe1p92252>
