Date: Tue, 20 Nov 2001 11:30:02 -0800 (PST) From: Ian Dowse <iedowse@maths.tcd.ie> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/32138: better progress reporting for dump(8) Message-ID: <200111201930.fAKJU2K90640@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: Ian Dowse <iedowse@maths.tcd.ie>
To: Mikhail Teterin <mi@aldan.algebra.com>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111201930.fAKJU2K90640>
