Annotation of 41BSD/cmd/uucp/xqt.c, revision 1.1

1.1     ! root        1: #include "uucp.h"
        !             2: #include <signal.h>
        !             3: 
        !             4: 
        !             5: /*******
        !             6:  *     xuucico(rmtname)                start up uucico for rmtname
        !             7:  *     char *rmtname;
        !             8:  *
        !             9:  *     return codes:  none
        !            10:  */
        !            11: 
        !            12: xuucico(rmtname)
        !            13: char *rmtname;
        !            14: {
        !            15:        if (fork() == 0) {
        !            16:                /*  start uucico for rmtname system  */
        !            17:                char opt[100];
        !            18:                close(0);
        !            19:                close(1);
        !            20:                close(2);
        !            21:                open("/dev/null", 0);
        !            22:                open("/dev/null", 1);
        !            23:                open("/dev/null", 1);
        !            24:                signal(SIGINT, SIG_IGN);
        !            25:                signal(SIGHUP, SIG_IGN);
        !            26:                signal(SIGQUIT, SIG_IGN);
        !            27:                signal(SIGKILL, SIG_IGN);
        !            28:                if (rmtname[0] != '\0')
        !            29:                        sprintf(opt, "-s%.7s", rmtname);
        !            30:                else
        !            31:                        opt[0] = '\0';
        !            32:                execl(UUCICO, "UUCICO", "-r1", opt, 0);
        !            33:                exit(100);
        !            34:        }
        !            35:        return;
        !            36: }
        !            37: 
        !            38: 
        !            39: /*******
        !            40:  *     xuuxqt()                start up uuxqt
        !            41:  *
        !            42:  *     return codes:  none
        !            43:  */
        !            44: 
        !            45: xuuxqt()
        !            46: {
        !            47:        if (fork() == 0) {
        !            48:                /*  start uuxqt  */
        !            49:                close(0);
        !            50:                close(1);
        !            51:                close(2);
        !            52:                open("/dev/null", 2);
        !            53:                open("/dev/null", 2);
        !            54:                open("/dev/null", 2);
        !            55:                signal(SIGINT, SIG_IGN);
        !            56:                signal(SIGHUP, SIG_IGN);
        !            57:                signal(SIGQUIT, SIG_IGN);
        !            58:                signal(SIGKILL, SIG_IGN);
        !            59:                execl(UUXQT, "UUXQT",  0);
        !            60:                exit(100);
        !            61:        }
        !            62:        return;
        !            63: }
        !            64: xuucp(str)
        !            65: char *str;
        !            66: {
        !            67:        char text[300];
        !            68:        if (fork() == 0) {
        !            69:                /*  start uucp  */
        !            70:                close(0);
        !            71:                close(1);
        !            72:                close(2);
        !            73:                open("/dev/null", 0);
        !            74:                open("/dev/null", 1);
        !            75:                open("/dev/null", 1);
        !            76:                signal(SIGINT, SIG_IGN);
        !            77:                signal(SIGHUP, SIG_IGN);
        !            78:                signal(SIGQUIT, SIG_IGN);
        !            79:                signal(SIGKILL, SIG_IGN);
        !            80:                sprintf(text, "%s -r %s", UUCP, str);
        !            81:                execl(SHELL, "sh", "-c", text, 0);
        !            82:                exit(100);
        !            83:        }
        !            84:        sleep(15);
        !            85:        return;
        !            86: }

unix.superglobalmegacorp.com

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