Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2009 17:05:54 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194200 - stable/7/bin/ps
Message-ID:  <200906141705.n5EH5sHg055022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Jun 14 17:05:54 2009
New Revision: 194200
URL: http://svn.freebsd.org/changeset/base/194200

Log:
  MFC r192688: fix nonsense in ps etime field for swapped out processes
  
  PR:		bin/123069
  Submitted by:	Vladimir Kozbin
  Approved by:	ed (mentor)

Modified:
  stable/7/bin/ps/   (props changed)
  stable/7/bin/ps/print.c

Modified: stable/7/bin/ps/print.c
==============================================================================
--- stable/7/bin/ps/print.c	Sun Jun 14 17:03:59 2009	(r194199)
+++ stable/7/bin/ps/print.c	Sun Jun 14 17:05:54 2009	(r194200)
@@ -572,6 +572,10 @@ elapsed(KINFO *k, VARENT *ve)
 	char obuff[128];
 
 	v = ve->var;
+	if (!k->ki_valid) {
+		(void)printf("%-*s", v->width, "-");
+		return;
+	}
 	val = now - k->ki_p->ki_start.tv_sec;
 	days = val / (24 * 60 * 60);
 	val %= 24 * 60 * 60;



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