diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2011-07-10 06:13:56 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2011-07-10 06:13:56 +0000 |
commit | 1b048a82de1a11bdcc6c4fece61e470fbe9230c0 (patch) | |
tree | a8ea52a4c422ec288b6d6409134193213aab4c42 /usr.bin | |
parent | f1a7c45aca309282c007bcc7bdd77667654d7bd6 (diff) |
Make -m 0 work as expected.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/kdump/kdump.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 794bda46e70..bb46cdcaca8 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.57 2011/07/09 07:22:05 otto Exp $ */ +/* $OpenBSD: kdump.c,v 1.58 2011/07/10 06:13:55 otto Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -63,7 +63,7 @@ #include "kdump_subr.h" #include "extern.h" -int timestamp, decimal, iohex, fancy = 1, tail, maxdata, resolv; +int timestamp, decimal, iohex, fancy = 1, tail, maxdata = INT_MAX, resolv; char *tracefile = DEF_TRACEFILE; struct ktr_header ktr_header; pid_t pid = -1; @@ -774,7 +774,9 @@ ktrgenio(struct ktr_genio *ktr, size_t len) } printf("fd %d %s %zu bytes\n", ktr->ktr_fd, ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen); - if (maxdata && datalen > maxdata) + if (maxdata == 0) + return; + if (datalen > maxdata) datalen = maxdata; if (iohex && !datalen) return; |