Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2013 20:04:05 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259566 - head/usr.bin/netstat
Message-ID:  <201312182004.rBIK45fb050478@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Wed Dec 18 20:04:04 2013
New Revision: 259566
URL: http://svnweb.freebsd.org/changeset/base/259566

Log:
  Restore corefiles handling via kvm(3).
  
  Found by:	John-Mark Gurney <jmg at funkthat.com>
  MFC after:	4 weeks

Modified:
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c

Modified: head/usr.bin/netstat/main.c
==============================================================================
--- head/usr.bin/netstat/main.c	Wed Dec 18 19:25:40 2013	(r259565)
+++ head/usr.bin/netstat/main.c	Wed Dec 18 20:04:04 2013	(r259566)
@@ -319,6 +319,7 @@ int	gflag;		/* show group (multicast) ro
 int	hflag;		/* show counters in human readable format */
 int	iflag;		/* show interfaces */
 int	Lflag;		/* show size of listen queues */
+int	Mflag;		/* read statistics from core */
 int	mflag;		/* show memory stats */
 int	noutputs = 0;	/* how much outputs before we exit */
 int	numeric_addr;	/* show addresses numerically */
@@ -424,6 +425,7 @@ main(int argc, char *argv[])
 			Lflag = 1;
 			break;
 		case 'M':
+			Mflag = 1;
 			memf = optarg;
 			break;
 		case 'm':

Modified: head/usr.bin/netstat/netstat.h
==============================================================================
--- head/usr.bin/netstat/netstat.h	Wed Dec 18 19:25:40 2013	(r259565)
+++ head/usr.bin/netstat/netstat.h	Wed Dec 18 20:04:04 2013	(r259566)
@@ -40,6 +40,7 @@ extern int	gflag;	/* show group (multica
 extern int	hflag;	/* show counters in human readable format */
 extern int	iflag;	/* show interfaces */
 extern int	Lflag;	/* show size of listen queues */
+extern int	Mflag;	/* read statistics from core */
 extern int	mflag;	/* show memory stats */
 extern int	noutputs;	/* how much outputs before we exit */
 extern int	numeric_addr;	/* show addresses numerically */

Modified: head/usr.bin/netstat/route.c
==============================================================================
--- head/usr.bin/netstat/route.c	Wed Dec 18 19:25:40 2013	(r259565)
+++ head/usr.bin/netstat/route.c	Wed Dec 18 20:04:04 2013	(r259566)
@@ -182,7 +182,7 @@ routepr(u_long rtree, int fibnum)
 		printf(" (fib: %d)", fibnum);
 	printf("\n");
 
-	if (Aflag == 0 && NewTree)
+	if (Aflag == 0 && Mflag == 0 && NewTree)
 		ntreestuff(fibnum, af);
 	else {
 		if (rtree == 0) {



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