1: #ifndef lint
2: static char sccsid[] = "@(#)maktee.c 4.2 (Berkeley) 4/25/83";
3: #endif not lint
4:
5: #include "stdio.h"
6: #include "signal.h"
7: #include "lrnref.h"
8:
9: static int oldout;
10: static char tee[50];
11:
12: maktee()
13: {
14: int fpip[2], in, out;
15:
16: if (tee[0] == 0)
17: sprintf(tee, "%s/bin/lrntee", direct);
18: pipe(fpip);
19: in = fpip[0];
20: out= fpip[1];
21: if (fork() == 0) {
22: signal(SIGINT, SIG_IGN);
23: close(0);
24: close(out);
25: dup(in);
26: close(in);
27: execl (tee, "lrntee", 0);
28: perror(tee);
29: fprintf(stderr, "Maktee: lrntee exec failed\n");
30: exit(1);
31: }
32: close(in);
33: fflush(stdout);
34: oldout = dup(1);
35: close(1);
36: if (dup(out) != 1) {
37: perror("dup");
38: fprintf(stderr, "Maktee: error making tee for copyout\n");
39: }
40: close(out);
41: return(1);
42: }
43:
44: untee()
45: {
46: int x;
47:
48: fflush(stdout);
49: close(1);
50: dup(oldout);
51: close(oldout);
52: wait(&x);
53: }
Defined functions
untee
defined in line
44; used 2 times
Defined variables
oldout
defined in line
9; used 3 times
sccsid
defined in line
2;
never used
tee
defined in line
10; used 4 times