Module Name:    src
Committed By:   pooka
Date:           Wed Mar  9 12:56:09 UTC 2011

Modified Files:
        src/usr.bin/shmif_dumpbus: shmif_dumpbus.c

Log Message:
print processing details only if we've not outputting a pcap file
to stdout


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/shmif_dumpbus/shmif_dumpbus.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/shmif_dumpbus/shmif_dumpbus.c
diff -u src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.1 src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.2
--- src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.1	Wed Jan 12 16:14:24 2011
+++ src/usr.bin/shmif_dumpbus/shmif_dumpbus.c	Wed Mar  9 12:56:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmif_dumpbus.c,v 1.1 2011/01/12 16:14:24 pooka Exp $	*/
+/*	$NetBSD: shmif_dumpbus.c,v 1.2 2011/03/09 12:56:08 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -139,7 +139,7 @@
 		if (write(pfd, &phdr, sizeof(phdr)) != sizeof(phdr))
 			err(1, "phdr write");
 	} else {
-		pfd = 0; /* XXXgcc */
+		pfd = -1; /* XXXgcc */
 	}
 	
 	curbus = bmem->shm_first;
@@ -167,8 +167,10 @@
 		if (sp.sp_len == 0)
 			continue;
 
-		printf("packet %d, offset 0x%04x, length 0x%04x, ts %d/%06d\n",
-		    i++, curbus, sp.sp_len, sp.sp_sec, sp.sp_usec);
+		if (pfd != STDOUT_FILENO)
+			printf("packet %d, offset 0x%04x, length 0x%04x, "
+			    "ts %d/%06d\n", i++, curbus,
+			    sp.sp_len, sp.sp_sec, sp.sp_usec);
 
 		if (!pcapfile || sp.sp_len == 0) {
 			curbus = shmif_busread(bmem,

Reply via email to