Annotation of cci/usr/src/usr.bin/learn/makpipe.c, revision 1.1.1.2

1.1       root        1: #ifndef lint
                      2: static char sccsid[] = "@(#)makpipe.c  4.2     (Berkeley)      4/25/83";
                      3: #endif not lint
                      4: 
                      5: #include "stdio.h"
                      6: 
                      7: makpipe()
                      8: {
                      9:        int f[2];
                     10: 
                     11:        pipe(f);
                     12:        if (fork()==0) {
                     13:                close(f[1]);
                     14:                close(0);
                     15:                dup(f[0]);
                     16:                close(f[0]);
1.1.1.2 ! root       17: /* #if vax */
1.1       root       18:                execl ("/bin/sh", "sh", "-i", 0);
                     19:                execl ("/usr/ucb/bin/sh", "sh", "-i", 0);
1.1.1.2 ! root       20: /* #else */
        !            21: /*             execl("/bin/csh", "csh", "-if", 0);         */
        !            22: /*             execl("/usr/ucb/bin/csh", "csh", "-if", 0); */
        !            23: /* #endif */
1.1       root       24:                write(2, "Exec error\n", 11);
                     25:        }
                     26:        close(f[0]);
                     27:        sleep(2);       /* so shell won't eat up too much input */
                     28:        return(f[1]);
                     29: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.