svn commit: r192688 - head/bin/ps

Jilles Tjoelker jilles at FreeBSD.org
Sun May 24 15:32:34 UTC 2009


Author: jilles
Date: Sun May 24 15:32:34 2009
New Revision: 192688
URL: http://svn.freebsd.org/changeset/base/192688

Log:
  Fix elapsed (etime) field for swapped out processes in ps:
  show '-' instead of time since the Epoch.
  
  PR:		bin/123069
  Submitted by:	Vladimir Kozbin
  Approved by:	ed (mentor)
  MFC after:	3 weeks

Modified:
  head/bin/ps/print.c

Modified: head/bin/ps/print.c
==============================================================================
--- head/bin/ps/print.c	Sun May 24 15:27:25 2009	(r192687)
+++ head/bin/ps/print.c	Sun May 24 15:32:34 2009	(r192688)
@@ -596,6 +596,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;


More information about the svn-src-all mailing list