Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 2009 16:17:48 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192252 - head/sys/kern
Message-ID:  <200905171617.n4HGHmQ1032397@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun May 17 16:17:48 2009
New Revision: 192252
URL: http://svn.freebsd.org/changeset/base/192252

Log:
  Print an extra newline when not at the first column already.
  
  This makes siginfo output look a lot better when pressing it the first
  time when in sh(1), for example:
  
  	$ load: 0.00  cmd: sh 1945 [ttyin] 3.94r 0.00u 0.00s 0% 1960k
  	load: 0.00  cmd: sh 1945 [ttyin] 4.19r 0.00u 0.00s 0% 1960k
  
  will now become:
  
  	$
  	load: 0.00  cmd: sh 1945 [ttyin] 3.94r 0.00u 0.00s 0% 1960k
  	load: 0.00  cmd: sh 1945 [ttyin] 4.19r 0.00u 0.00s 0% 1960k

Modified:
  head/sys/kern/tty_info.c

Modified: head/sys/kern/tty_info.c
==============================================================================
--- head/sys/kern/tty_info.c	Sun May 17 15:42:41 2009	(r192251)
+++ head/sys/kern/tty_info.c	Sun May 17 16:17:48 2009	(r192252)
@@ -230,7 +230,8 @@ tty_info(struct tty *tp)
 
 	/* Print load average. */
 	load = (averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT;
-	ttyprintf(tp, "load: %d.%02d ", load / 100, load % 100);
+	ttyprintf(tp, "%sload: %d.%02d ", tp->t_column == 0 ? "" : "\n",
+	    load / 100, load % 100);
 
 	if (tp->t_session == NULL) {
 		ttyprintf(tp, "not a controlling terminal\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905171617.n4HGHmQ1032397>