mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Always write record counts to stderr.
This commit is contained in:
parent
221b2ea6c4
commit
73f6a1b058
@ -41,6 +41,7 @@
|
|||||||
-- Don't save/restore vi readonly flag if vi is compiled read-only.
|
-- Don't save/restore vi readonly flag if vi is compiled read-only.
|
||||||
-- Reworked rdate option handling (is now smaller).
|
-- Reworked rdate option handling (is now smaller).
|
||||||
-- Size reduction in ping
|
-- Size reduction in ping
|
||||||
|
-- Always write dd counts to stderr
|
||||||
* Aaron Lehmann
|
* Aaron Lehmann
|
||||||
-- slimmed down md5sum
|
-- slimmed down md5sum
|
||||||
-- contributed a nice new (hand written, not lex/yacc) Posix math
|
-- contributed a nice new (hand written, not lex/yacc) Posix math
|
||||||
|
@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
|
|||||||
size_t bs = 512, count = -1;
|
size_t bs = 512, count = -1;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
off_t seek = 0, skip = 0;
|
off_t seek = 0, skip = 0;
|
||||||
FILE *statusfp;
|
|
||||||
char *infile = NULL, *outfile = NULL, *buf;
|
char *infile = NULL, *outfile = NULL, *buf;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
|
|||||||
if (ftruncate(ofd, seek * bs) < 0)
|
if (ftruncate(ofd, seek * bs) < 0)
|
||||||
perror_msg_and_die("%s", outfile);
|
perror_msg_and_die("%s", outfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
statusfp = stdout;
|
|
||||||
} else {
|
} else {
|
||||||
ofd = STDOUT_FILENO;
|
ofd = STDOUT_FILENO;
|
||||||
outfile = "standard output";
|
outfile = "standard output";
|
||||||
statusfp = stderr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skip) {
|
if (skip) {
|
||||||
@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
|
|||||||
out_part++;
|
out_part++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part);
|
fprintf(stderr, "%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 out\n", (long)out_full, (long)out_part);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
8
dd.c
8
dd.c
@ -50,7 +50,6 @@ int dd_main(int argc, char **argv)
|
|||||||
size_t bs = 512, count = -1;
|
size_t bs = 512, count = -1;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
off_t seek = 0, skip = 0;
|
off_t seek = 0, skip = 0;
|
||||||
FILE *statusfp;
|
|
||||||
char *infile = NULL, *outfile = NULL, *buf;
|
char *infile = NULL, *outfile = NULL, *buf;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
@ -110,12 +109,9 @@ int dd_main(int argc, char **argv)
|
|||||||
if (ftruncate(ofd, seek * bs) < 0)
|
if (ftruncate(ofd, seek * bs) < 0)
|
||||||
perror_msg_and_die("%s", outfile);
|
perror_msg_and_die("%s", outfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
statusfp = stdout;
|
|
||||||
} else {
|
} else {
|
||||||
ofd = STDOUT_FILENO;
|
ofd = STDOUT_FILENO;
|
||||||
outfile = "standard output";
|
outfile = "standard output";
|
||||||
statusfp = stderr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skip) {
|
if (skip) {
|
||||||
@ -151,8 +147,8 @@ int dd_main(int argc, char **argv)
|
|||||||
out_part++;
|
out_part++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(statusfp, "%ld+%ld records in\n", (long)in_full, (long)in_part);
|
fprintf(stderr, "%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 out\n", (long)out_full, (long)out_part);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user