Module Name:    src
Committed By:   enami
Date:           Thu Oct  9 23:45:47 UTC 2014

Modified Files:
        src/usr.bin/netstat: main.c

Log Message:
Fix a bug introduced in rev. 1.62; it fails to negate (a && b).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/netstat/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/netstat/main.c
diff -u src/usr.bin/netstat/main.c:1.91 src/usr.bin/netstat/main.c:1.92
--- src/usr.bin/netstat/main.c:1.91	Fri May 30 01:44:21 2014
+++ src/usr.bin/netstat/main.c	Thu Oct  9 23:45:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $	*/
+/*	$NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "from: @(#)main.c	8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $");
+__RCSID("$NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -344,12 +344,17 @@ prepare(const char *nf, const char *mf, 
 	/*
 	 * Try to figure out if we can use sysctl or not.
 	 */
-	if (nf != NULL && mf != NULL) {
+	if (nf != NULL || mf != NULL) {
 		/* Of course, we can't use sysctl with dumps. */
 		if (force_sysctl)
 			errx(EXIT_FAILURE, "can't use sysctl with dumps");
 
-		/* If we have -M and -N, we're not dealing with live memory. */
+		/*
+		 * If we have -M or -N, we're not dealing with live memory
+		 * or want to use kvm interface explicitly.  It is sometimes
+		 * useful to dig inside of kernel without extending
+		 * sysctl interface (i.e., without rebuilding kernel).
+		 */
 		use_sysctl = 0;
 	} else if (qflag ||
 		   iflag ||

Reply via email to