summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2001-07-31 21:02:19 +0000
committerMatt Kraai2001-07-31 21:02:19 +0000
commit73f6a1b058e994a44820b3ee987b04d14f05051d (patch)
tree887a6fb5aa33e2744886ca964e74c3726289ca33
parent221b2ea6c40e5b2e0123a0c9a4ba6e74d86eb33f (diff)
downloadbusybox-73f6a1b058e994a44820b3ee987b04d14f05051d.zip
busybox-73f6a1b058e994a44820b3ee987b04d14f05051d.tar.gz
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 efd593a..45005b5 100644
--- a/Changelog
+++ b/Changelog
@@ -41,6 +41,7 @@
-- Don't save/restore vi readonly flag if vi is compiled read-only.
-- Reworked rdate option handling (is now smaller).
-- Size reduction in ping
+ -- Always write dd counts to stderr
* Aaron Lehmann
-- slimmed down md5sum
-- contributed a nice new (hand written, not lex/yacc) Posix math
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 297d0ab..d46db82 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
size_t bs = 512, count = -1;
ssize_t n;
off_t seek = 0, skip = 0;
- FILE *statusfp;
char *infile = NULL, *outfile = NULL, *buf;
for (i = 1; i < argc; i++) {
@@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
if (ftruncate(ofd, seek * bs) < 0)
perror_msg_and_die("%s", outfile);
}
-
- statusfp = stdout;
} else {
ofd = STDOUT_FILENO;
outfile = "standard output";
- statusfp = stderr;
}
if (skip) {
@@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
out_part++;
}
- fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part);
- fprintf(statusfp, "%ld+%ld records out\n", (long)out_full, (long)out_part);
+ fprintf(stderr, "%ld+%ld records in\n", (long)in_full, (long)in_part);
+ fprintf(stderr, "%ld+%ld records out\n", (long)out_full, (long)out_part);
return EXIT_SUCCESS;
}
diff --git a/dd.c b/dd.c
index 297d0ab..d46db82 100644
--- a/dd.c
+++ b/dd.c
@@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
size_t bs = 512, count = -1;
ssize_t n;
off_t seek = 0, skip = 0;
- FILE *statusfp;
char *infile = NULL, *outfile = NULL, *buf;
for (i = 1; i < argc; i++) {
@@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
if (ftruncate(ofd, seek * bs) < 0)
perror_msg_and_die("%s", outfile);
}
-
- statusfp = stdout;
} else {
ofd = STDOUT_FILENO;
outfile = "standard output";
- statusfp = stderr;
}
if (skip) {
@@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
out_part++;
}
- fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part);
- fprintf(statusfp, "%ld+%ld records out\n", (long)out_full, (long)out_part);
+ fprintf(stderr, "%ld+%ld records in\n", (long)in_full, (long)in_part);
+ fprintf(stderr, "%ld+%ld records out\n", (long)out_full, (long)out_part);
return EXIT_SUCCESS;
}