dj(1): make printio fprintio
This commit is contained in:
parent
f49a2d2eb8
commit
fc0d9e374b
10
src/dj.c
10
src/dj.c
|
@ -113,9 +113,9 @@ oserr(char *s){
|
||||||
/* Prints statistics regarding the use of dj, particularly partially and
|
/* Prints statistics regarding the use of dj, particularly partially and
|
||||||
* completely read and written records. */
|
* completely read and written records. */
|
||||||
static void
|
static void
|
||||||
printio(char *fmt, struct Io io[2]){
|
fprintio(FILE *stream, char *fmt, struct Io io[2]){
|
||||||
|
|
||||||
fprintf(stderr, fmt,
|
fprintf(stream, fmt,
|
||||||
io[0].rec, io[0].prec, io[1].rec, io[1].prec,
|
io[0].rec, io[0].prec, io[1].rec, io[1].prec,
|
||||||
io[0].bytes, io[1].bytes);
|
io[0].bytes, io[1].bytes);
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ int main(int argc, char *argv[]){
|
||||||
|
|
||||||
if(io[0].bufuse < io[0].bs){
|
if(io[0].bufuse < io[0].bs){
|
||||||
fprintf(stderr, "%s: Partial read:\n\t", program_name);
|
fprintf(stderr, "%s: Partial read:\n\t", program_name);
|
||||||
printio(fmt, io);
|
fprintio(stderr, fmt, io);
|
||||||
if(!noerror)
|
if(!noerror)
|
||||||
count = 1;
|
count = 1;
|
||||||
if(align >= 0){
|
if(align >= 0){
|
||||||
|
@ -328,7 +328,7 @@ int main(int argc, char *argv[]){
|
||||||
}else if(t > io[1].bufuse && io[1].bufuse > 0){
|
}else if(t > io[1].bufuse && io[1].bufuse > 0){
|
||||||
io[1].prec += 1;
|
io[1].prec += 1;
|
||||||
fprintf(stderr, "%s: Partial write:\n\t", program_name);
|
fprintf(stderr, "%s: Partial write:\n\t", program_name);
|
||||||
printio(fmt, io);
|
fprintio(stderr, fmt, io);
|
||||||
if(!noerror)
|
if(!noerror)
|
||||||
count = 1;
|
count = 1;
|
||||||
}else if(io[1].bufuse == 0 && t < io[1].bs)
|
}else if(io[1].bufuse == 0 && t < io[1].bs)
|
||||||
|
@ -338,7 +338,7 @@ int main(int argc, char *argv[]){
|
||||||
}while(io[0].bufuse > 0);
|
}while(io[0].bufuse > 0);
|
||||||
}while(count == 0 || --count > 0);
|
}while(count == 0 || --count > 0);
|
||||||
|
|
||||||
printio(fmt, io);
|
fprintio(stderr, fmt, io);
|
||||||
|
|
||||||
return EX_OK;
|
return EX_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user