aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-07-31 21:02:19 +0000
committerMatt Kraai <kraai@debian.org>2001-07-31 21:02:19 +0000
commit73f6a1b058e994a44820b3ee987b04d14f05051d (patch)
tree887a6fb5aa33e2744886ca964e74c3726289ca33
parent221b2ea6c40e5b2e0123a0c9a4ba6e74d86eb33f (diff)
downloadbusybox-w32-73f6a1b058e994a44820b3ee987b04d14f05051d.tar.gz
busybox-w32-73f6a1b058e994a44820b3ee987b04d14f05051d.tar.bz2
busybox-w32-73f6a1b058e994a44820b3ee987b04d14f05051d.zip
Always write record counts to stderr.
-rw-r--r--Changelog1
-rw-r--r--coreutils/dd.c8
-rw-r--r--dd.c8
3 files changed, 5 insertions, 12 deletions
diff --git a/Changelog b/Changelog
index efd593ad6..45005b589 100644
--- a/Changelog
+++ b/Changelog
@@ -41,6 +41,7 @@
41 -- Don't save/restore vi readonly flag if vi is compiled read-only. 41 -- Don't save/restore vi readonly flag if vi is compiled read-only.
42 -- Reworked rdate option handling (is now smaller). 42 -- Reworked rdate option handling (is now smaller).
43 -- Size reduction in ping 43 -- Size reduction in ping
44 -- Always write dd counts to stderr
44 * Aaron Lehmann 45 * Aaron Lehmann
45 -- slimmed down md5sum 46 -- slimmed down md5sum
46 -- contributed a nice new (hand written, not lex/yacc) Posix math 47 -- contributed a nice new (hand written, not lex/yacc) Posix math
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 297d0ab51..d46db82a0 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
50 size_t bs = 512, count = -1; 50 size_t bs = 512, count = -1;
51 ssize_t n; 51 ssize_t n;
52 off_t seek = 0, skip = 0; 52 off_t seek = 0, skip = 0;
53 FILE *statusfp;
54 char *infile = NULL, *outfile = NULL, *buf; 53 char *infile = NULL, *outfile = NULL, *buf;
55 54
56 for (i = 1; i < argc; i++) { 55 for (i = 1; i < argc; i++) {
@@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
110 if (ftruncate(ofd, seek * bs) < 0) 109 if (ftruncate(ofd, seek * bs) < 0)
111 perror_msg_and_die("%s", outfile); 110 perror_msg_and_die("%s", outfile);
112 } 111 }
113
114 statusfp = stdout;
115 } else { 112 } else {
116 ofd = STDOUT_FILENO; 113 ofd = STDOUT_FILENO;
117 outfile = "standard output"; 114 outfile = "standard output";
118 statusfp = stderr;
119 } 115 }
120 116
121 if (skip) { 117 if (skip) {
@@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
151 out_part++; 147 out_part++;
152 } 148 }
153 149
154 fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part); 150 fprintf(stderr, "%ld+%ld records in\n", (long)in_full, (long)in_part);
155 fprintf(statusfp, "%ld+%ld records out\n", (long)out_full, (long)out_part); 151 fprintf(stderr, "%ld+%ld records out\n", (long)out_full, (long)out_part);
156 152
157 return EXIT_SUCCESS; 153 return EXIT_SUCCESS;
158} 154}
diff --git a/dd.c b/dd.c
index 297d0ab51..d46db82a0 100644
--- a/dd.c
+++ b/dd.c
@@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
50 size_t bs = 512, count = -1; 50 size_t bs = 512, count = -1;
51 ssize_t n; 51 ssize_t n;
52 off_t seek = 0, skip = 0; 52 off_t seek = 0, skip = 0;
53 FILE *statusfp;
54 char *infile = NULL, *outfile = NULL, *buf; 53 char *infile = NULL, *outfile = NULL, *buf;
55 54
56 for (i = 1; i < argc; i++) { 55 for (i = 1; i < argc; i++) {
@@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
110 if (ftruncate(ofd, seek * bs) < 0) 109 if (ftruncate(ofd, seek * bs) < 0)
111 perror_msg_and_die("%s", outfile); 110 perror_msg_and_die("%s", outfile);
112 } 111 }
113
114 statusfp = stdout;
115 } else { 112 } else {
116 ofd = STDOUT_FILENO; 113 ofd = STDOUT_FILENO;
117 outfile = "standard output"; 114 outfile = "standard output";
118 statusfp = stderr;
119 } 115 }
120 116
121 if (skip) { 117 if (skip) {
@@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
151 out_part++; 147 out_part++;
152 } 148 }
153 149
154 fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part); 150 fprintf(stderr, "%ld+%ld records in\n", (long)in_full, (long)in_part);
155 fprintf(statusfp, "%ld+%ld records out\n", (long)out_full, (long)out_part); 151 fprintf(stderr, "%ld+%ld records out\n", (long)out_full, (long)out_part);
156 152
157 return EXIT_SUCCESS; 153 return EXIT_SUCCESS;
158} 154}