From a2011320f6e1417cb997bb63e2cd7d5b8bfd96c4 Mon Sep 17 00:00:00 2001 From: in2 Date: Sat, 29 Mar 2003 09:52:18 +0000 Subject: reprint header when SIGINT. discard first data git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@746 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/diskstat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/diskstat.c b/util/diskstat.c index 0eef081b..f4146026 100644 --- a/util/diskstat.c +++ b/util/diskstat.c @@ -596,12 +596,14 @@ phdr(int signo) } -int counttimes, busydata[1024]; +int counttimes = -1, busydata[1024]; static void printresult(int p) { int dn; - for (dn = 0; dn < num_devices; dn++) + printf("\n"); + phdr(0); + for (dn = 0; dn < maxshowdevs; dn++) printf(" %3d%% ", (busydata[dn] / counttimes)); printf("\n"); exit(0); -- cgit v1.2.3