diff options
author | 2001-10-04 20:32:27 +0000 | |
---|---|---|
committer | 2001-10-04 20:32:27 +0000 | |
commit | 1502d8fdaf9a52b28209f38a2139b8b7cefe3d1f (patch) | |
tree | ff72a4bece7f5ed2ffc63ceb48efe828807e8170 | |
parent | Driver skeleton for Guillemot Maxi Radio FM2000 PCI Radio Card. (diff) | |
download | wireguard-openbsd-1502d8fdaf9a52b28209f38a2139b8b7cefe3d1f.tar.xz wireguard-openbsd-1502d8fdaf9a52b28209f38a2139b8b7cefe3d1f.zip |
Move check for count=0 into dd's main. We want to do normal setup
in this case and just don't want to actually copy any data.
Fixes a problem noted by aaron@ where the time portion of the summary
would be wrong and also gives us sane behavior when seek is non-zero
but count is 0.
-rw-r--r-- | bin/dd/args.c | 6 | ||||
-rw-r--r-- | bin/dd/dd.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c index 95e4979601c..ed3522cd647 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.9 2001/08/07 14:39:27 hugh Exp $ */ +/* $OpenBSD: args.c,v 1.10 2001/10/04 20:32:27 millert Exp $ */ /* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: args.c,v 1.9 2001/08/07 14:39:27 hugh Exp $"; +static char rcsid[] = "$OpenBSD: args.c,v 1.10 2001/10/04 20:32:27 millert Exp $"; #endif #endif /* not lint */ @@ -212,8 +212,6 @@ f_count(arg) { cpy_cnt = get_bsz(arg); - if (!cpy_cnt) - terminate(0); } static void diff --git a/bin/dd/dd.c b/bin/dd/dd.c index b9daa89f8bf..03176396cd6 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dd.c,v 1.9 2001/08/07 14:39:27 hugh Exp $ */ +/* $OpenBSD: dd.c,v 1.10 2001/10/04 20:32:27 millert Exp $ */ /* $NetBSD: dd.c,v 1.6 1996/02/20 19:29:06 jtc Exp $ */ /*- @@ -48,7 +48,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: dd.c,v 1.9 2001/08/07 14:39:27 hugh Exp $"; +static char rcsid[] = "$OpenBSD: dd.c,v 1.10 2001/10/04 20:32:27 millert Exp $"; #endif #endif /* not lint */ @@ -97,8 +97,10 @@ main(argc, argv) atexit(summary); - while (files_cnt--) - dd_in(); + if (cpy_cnt > 0) { + while (files_cnt--) + dd_in(); + } dd_close(); exit(0); |