Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/shmif_dumpbus print processing details only if we've...



details:   https://anonhg.NetBSD.org/src/rev/a544af4995e0
branches:  trunk
changeset: 763056:a544af4995e0
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Mar 09 12:56:08 2011 +0000

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

diffstat:

 usr.bin/shmif_dumpbus/shmif_dumpbus.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r b9befc04d0d3 -r a544af4995e0 usr.bin/shmif_dumpbus/shmif_dumpbus.c
--- a/usr.bin/shmif_dumpbus/shmif_dumpbus.c     Wed Mar 09 12:33:59 2011 +0000
+++ b/usr.bin/shmif_dumpbus/shmif_dumpbus.c     Wed Mar 09 12:56:08 2011 +0000
@@ -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,



Home | Main Index | Thread Index | Old Index