BSD 4 release
[unix-history] / usr / src / cmd / tee.c
index 6050d31..834e755 100644 (file)
@@ -1,3 +1,4 @@
+static char *sccsid = "@(#)tee.c       4.1 (Berkeley) 10/1/80";
 /*
  * tee-- pipe fitting
  */
 /*
  * tee-- pipe fitting
  */
@@ -6,14 +7,17 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <pagsiz.h>
+
+#define        BUFSIZ  BSIZE
 int openf[20] = { 1 };
 int n = 1;
 int t = 0;
 int aflag;
 
 int openf[20] = { 1 };
 int n = 1;
 int t = 0;
 int aflag;
 
-char in[512];
+char in[BUFSIZ];
 
 
-char out[512];
+char out[BUFSIZ];
 
 extern errno;
 long   lseek();
 
 extern errno;
 long   lseek();
@@ -60,10 +64,10 @@ char **argv;
        }
        r = w = 0;
        for(;;) {
        }
        r = w = 0;
        for(;;) {
-               for(p=0;p<512;) {
+               for(p=0;p<BUFSIZ;) {
                        if(r>=w) {
                                if(t>0&&p>0) break;
                        if(r>=w) {
                                if(t>0&&p>0) break;
-                               w = read(0,in,512);
+                               w = read(0,in,BUFSIZ);
                                r = 0;
                                if(w<=0) {
                                        stash(p);
                                r = 0;
                                if(w<=0) {
                                        stash(p);