From a0065a57e41ffa4aad6781fb220f205ca1c31c4d Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 30 Oct 2023 19:43:33 +0000 Subject: [PATCH] fix rev 1.70: -X is 1 line output, avoids printing the header too often. --- usr.sbin/iostat/iostat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 74d2f63df220..dbc7919f1ad3 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -1,4 +1,4 @@ -/* $NetBSD: iostat.c,v 1.71 2023/07/28 12:03:33 wiz Exp $ */ +/* $NetBSD: iostat.c,v 1.72 2023/10/30 19:43:33 mrg Exp $ */ /* * Copyright (c) 1996 John M. Vinopal @@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1991, 1993\ #if 0 static char sccsid[] = "@(#)iostat.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: iostat.c,v 1.71 2023/07/28 12:03:33 wiz Exp $"); +__RCSID("$NetBSD: iostat.c,v 1.72 2023/10/30 19:43:33 mrg Exp $"); #endif #endif /* not lint */ @@ -357,9 +357,12 @@ main(int argc, char *argv[]) do_header = 1; for (hdrcnt = 1;;) { - if (ISSET(todo, SHOW_STATS_X | SHOW_STATS_3 | SHOW_STATS_Y)) { + if (ISSET(todo, SHOW_STATS_X | SHOW_STATS_Y)) { lines = ndrives; hdroffset = 3; + } else if (ISSET(todo, SHOW_STATS_3)) { + lines = 1; + hdroffset = 3; } else { lines = 1; hdroffset = 4;