From owner-svn-soc-all@FreeBSD.ORG Mon Jun 30 08:27:54 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B833BE34 for ; Mon, 30 Jun 2014 08:27:54 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A46EA2BED for ; Mon, 30 Jun 2014 08:27:54 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U8RsFD022750 for ; Mon, 30 Jun 2014 08:27:54 GMT (envelope-from zkorchev@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s5U8RsHl022631 for svn-soc-all@FreeBSD.org; Mon, 30 Jun 2014 08:27:54 GMT (envelope-from zkorchev@FreeBSD.org) Date: Mon, 30 Jun 2014 08:27:54 GMT Message-Id: <201406300827.s5U8RsHl022631@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zkorchev@FreeBSD.org using -f From: zkorchev@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r270205 - soc2014/zkorchev/freebsd_head/usr.sbin/iostat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 08:27:54 -0000 Author: zkorchev Date: Mon Jun 30 08:27:53 2014 New Revision: 270205 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=270205 Log: fixed iostat -c Modified: soc2014/zkorchev/freebsd_head/usr.sbin/iostat/iostat.c Modified: soc2014/zkorchev/freebsd_head/usr.sbin/iostat/iostat.c ============================================================================== --- soc2014/zkorchev/freebsd_head/usr.sbin/iostat/iostat.c Mon Jun 30 08:01:03 2014 (r270204) +++ soc2014/zkorchev/freebsd_head/usr.sbin/iostat/iostat.c Mon Jun 30 08:27:53 2014 (r270205) @@ -452,7 +452,8 @@ #if defined(SOL_ON) sol_format = sol_init(&sol_stream); - if (sol_format) sol_map_start(&sol_stream); + if (sol_format && cflag) + sol_array_start(&sol_stream); #endif for (headercount = 1;;) { @@ -460,6 +461,10 @@ long tmp; long double etime; +#if defined(SOL_ON) + if (sol_format) sol_map_start(&sol_stream); +#endif + if (Tflag > 0) { if ((readvar(kd, "kern.tty_nin", X_TTY_NIN, &cur.tk_nin, sizeof(cur.tk_nin)) != 0) @@ -621,10 +626,16 @@ if (Cflag > 0) cpustats(); - printf("\n"); +#if defined(SOL_ON) + if (!sol_format) +#endif + printf("\n"); } fflush(stdout); +#if defined(SOL_ON) + if (sol_format) sol_map_end(&sol_stream); +#endif if (count >= 0 && --count <= 0) break; @@ -634,7 +645,7 @@ #if defined(SOL_ON) if (sol_format) { - sol_map_end(&sol_stream); + if (cflag) sol_array_end(&sol_stream); sol_term(&sol_stream); } #endif