Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/kdump Make "-m0" print no data, so that we agree bet...



details:   https://anonhg.NetBSD.org/src/rev/9a029b4ad9ad
branches:  trunk
changeset: 542493:9a029b4ad9ad
user:      atatat <atatat%NetBSD.org@localhost>
date:      Thu Jan 30 21:43:26 2003 +0000

description:
Make "-m0" print no data, so that we agree better with the man page.

diffstat:

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

diffs (38 lines):

diff -r 089d8d0043f8 -r 9a029b4ad9ad usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c     Thu Jan 30 21:23:57 2003 +0000
+++ b/usr.bin/kdump/kdump.c     Thu Jan 30 21:43:26 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kdump.c,v 1.46 2002/12/09 21:29:28 manu Exp $  */
+/*     $NetBSD: kdump.c,v 1.47 2003/01/30 21:43:26 atatat Exp $        */
 
 /*-
  * Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)kdump.c    8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.46 2002/12/09 21:29:28 manu Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.47 2003/01/30 21:43:26 atatat Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,7 +71,7 @@
 
 #include <sys/syscall.h>
 
-int timestamp, decimal, plain, tail, maxdata, numeric;
+int timestamp, decimal, plain, tail, maxdata = -1, numeric;
 pid_t do_pid = -1;
 const char *tracefile = NULL;
 struct ktr_header ktr_header;
@@ -555,7 +555,9 @@
        }
        printf("fd %d %s %d bytes\n", ktr->ktr_fd,
                ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen);
-       if (maxdata && datalen > maxdata)
+       if (maxdata == 0)
+               return;
+       if (maxdata > 0 && datalen > maxdata)
                datalen = maxdata;
        (void)printf("       \"");
        col = 8;



Home | Main Index | Thread Index | Old Index