aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqorg11 <qorg@vxempire.xyz>2020-09-09 19:47:01 +0200
committerqorg11 <qorg@vxempire.xyz>2020-09-09 19:47:01 +0200
commit8f16928a591ac1b4432570aaf4034dc587932516 (patch)
tree11b8906b58590505c08168d9fe235113dece79e5
parentf4871118a45971814f8ae7a7b65156bb56d95a5b (diff)
downloadk9core-8f16928a591ac1b4432570aaf4034dc587932516.tar.gz
k9core-8f16928a591ac1b4432570aaf4034dc587932516.zip
POSIX, I don't really get you sometimes...
-rw-r--r--src/tee.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tee.c b/src/tee.c
index 7fc888a..7b52d3b 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -16,7 +16,11 @@ tee(int fd)
char buf[8192];
int read_bytes = 0;
while((read_bytes = read(0,buf,8192)) > 0)
- write(fd,buf,read_bytes);
+ {
+ write(fd,buf,read_bytes);
+ if(fd != 1)
+ write(1,buf,read_bytes);
+ }
return 1;
}