aboutsummaryrefslogtreecommitdiff
path: root/sbin/dump
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@FreeBSD.org>2006-08-05 12:50:38 +0000
committerRalf S. Engelschall <rse@FreeBSD.org>2006-08-05 12:50:38 +0000
commit452329ad118138b8736d30d53cfd36faed36ae51 (patch)
tree80e796539a757f61593c1a2f4017cf9eaee700e8 /sbin/dump
parent392cb477c311f688eb215b0cbb290e0917a72548 (diff)
downloadsrc-452329ad118138b8736d30d53cfd36faed36ae51.tar.gz
src-452329ad118138b8736d30d53cfd36faed36ae51.zip
Do not pass-through the tailing newline character from the ctime(3)
output to setproctitle(3) in order to get rid of the ugly two-character escape sequence "\n" in the ps(1) output of a dump(8) process: << [...] finished in 0:00 at Sat Aug 5 14:44:39 2006\n (dump) >> [...] finished in 0:00 at Sat Aug 5 14:44:39 2006 (dump)
Notes
Notes: svn path=/head/; revision=161000
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/optr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 3dc17b67db67..0d70b9e7be05 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -190,6 +190,7 @@ timeest(void)
{
double percent;
time_t tnow, tdone;
+ char *tdone_str;
int deltat, hours, mins;
(void)time(&tnow);
@@ -207,15 +208,16 @@ timeest(void)
hours = deltat / 3600;
mins = (deltat % 3600) / 60;
+ tdone_str = ctime(&tdone);
setproctitle(
- "%s: pass %d: %3.2f%% done, finished in %d:%02d at %s",
- disk, passno, percent, hours, mins, ctime(&tdone));
+ "%s: pass %d: %3.2f%% done, finished in %d:%02d at %.*s",
+ disk, passno, percent, hours, mins, strlen(tdone_str) - 1, tdone_str);
if (tnow >= tschedule) {
tschedule = tnow + 300;
if (blockswritten < 500)
return;
msg("%3.2f%% done, finished in %d:%02d at %s", percent,
- hours, mins, ctime(&tdone));
+ hours, mins, tdone_str);
}
}
}