projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Programma per stampare le quote disco
[gapil.git]
/
sources
/
tee.c
diff --git
a/sources/tee.c
b/sources/tee.c
index 559c94987cf010ed516e64cf280a96abbab8c731..d876ad998c31cd7a9f7381de8ef976f38497f959 100644
(file)
--- 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 */
/* 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) {
if (len == 0) break;
if (len < 0) {
if (errno == EAGAIN) {
@@
-125,7
+126,6
@@
int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
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);
/* write data to the file using splice */
while (len > 0) {
nwrite = splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);