X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=sources%2Ftee.c;h=d876ad998c31cd7a9f7381de8ef976f38497f959;hb=5d621249af8897e27fc0a842a33e7a7ef3b9c2ca;hp=559c94987cf010ed516e64cf280a96abbab8c731;hpb=fc2954a94ffab07871f49e2432d5223f55840fbf;p=gapil.git diff --git a/sources/tee.c b/sources/tee.c index 559c949..d876ad9 100644 --- a/sources/tee.c +++ b/sources/tee.c @@ -115,7 +115,8 @@ int main(int argc, char *argv[]) /* tee loop */ while (1) { /* copy stdin to stdout */ - len = tee(STDIN_FILENO, STDOUT_FILENO, size, SPLICE_F_NONBLOCK); + len = tee(STDIN_FILENO, STDOUT_FILENO, size, 0); + fprintf(stderr, "Copied %d byte\n", len); /* debug (use stderr!) */ if (len == 0) break; if (len < 0) { if (errno == EAGAIN) { @@ -125,7 +126,6 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } } - fprintf(stderr, "Copied %d byte\n", len); /* debug (use stderr!) */ /* write data to the file using splice */ while (len > 0) { nwrite = splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);