Annotation of 43BSDTahoe/usr.bin/uucp/xqt.c, revision 1.1.1.1

1.1       root        1: #ifndef lint
                      2: static char sccsid[] = "@(#)xqt.c      5.4     (Berkeley) 5/4/88";
                      3: #endif
                      4: 
                      5: #include <signal.h>
                      6: #include "uucp.h"
                      7: 
                      8: int LocalOnly = 0;
                      9: 
                     10: /*LINTLIBRARY*/
                     11: 
                     12: /*
                     13:  *     start up uucico for rmtname
                     14:  *
                     15:  *     return codes:  none
                     16:  */
                     17: 
                     18: #ifdef VMS
                     19: #define        fork    vfork
                     20: #endif VMS
                     21: 
                     22: xuucico(rmtname)
                     23: char *rmtname;
                     24: {
                     25:        if (fork() == 0) {
                     26:                /*  start uucico for rmtname system  */
                     27:                char opt[100];
                     28:                close(0);
                     29:                close(1);
                     30:                close(2);
                     31:                open(DEVNULL, 0);
                     32:                open(DEVNULL, 1);
                     33:                open(DEVNULL, 1);
                     34:                signal(SIGINT, SIG_IGN);
                     35:                signal(SIGHUP, SIG_IGN);
                     36:                signal(SIGQUIT, SIG_IGN);
                     37:                signal(SIGKILL, SIG_IGN);
                     38:                if (rmtname[0] != '\0')
                     39:                        sprintf(opt, "-s%s", rmtname);
                     40:                else
                     41:                        opt[0] = '\0';
                     42: #ifndef        VMS
                     43:                if (LocalOnly)
                     44:                        execl(UUCICO, "uucico", "-r1", "-L", opt, (char *)0);
                     45:                else
                     46:                        execl(UUCICO, "uucico", "-r1", opt, (char *)0);
                     47: #else  VMS
                     48:                /* Under VMS/EUNICE release the batch job */
                     49:                if (LocalOnly)
                     50:                        execl(STARTUUCP, "startuucp", "uucico", "-r1", "-L", opt, (char *)0);
                     51:                else
                     52:                        execl(STARTUUCP, "startuucp", "uucico", "-r1", opt, (char *)0);
                     53: #endif VMS
                     54:                exit(100);
                     55:        }
                     56: #ifdef VMS
                     57:        while(wait(0) != -1)
                     58:                ;       /* Wait for it to finish!! */
                     59: #endif VMS
                     60:        return;
                     61: }
                     62: 
                     63: /*
                     64:  *     start up uuxqt
                     65:  *
                     66:  *     return codes:  none
                     67:  */
                     68: xuuxqt()
                     69: {
                     70:        if (fork() == 0) {
                     71:                /*  start uuxqt  */
                     72:                close(0);
                     73:                close(1);
                     74:                close(2);
                     75:                open(DEVNULL, 2);
                     76:                open(DEVNULL, 2);
                     77:                open(DEVNULL, 2);
                     78:                signal(SIGINT, SIG_IGN);
                     79:                signal(SIGHUP, SIG_IGN);
                     80:                signal(SIGQUIT, SIG_IGN);
                     81:                signal(SIGKILL, SIG_IGN);
                     82:                execl(UUXQT, "uuxqt",  (char *)0);
                     83:                exit(100);
                     84:        }
                     85: }
                     86: 
                     87: xuucp(str)
                     88: char *str;
                     89: {
                     90:        char text[300];
                     91:        if (fork() == 0) {
                     92:                /*  start uucp  */
                     93:                close(0);
                     94:                close(1);
                     95:                close(2);
                     96:                open(DEVNULL, 0);
                     97:                open(DEVNULL, 1);
                     98:                open(DEVNULL, 1);
                     99:                signal(SIGINT, SIG_IGN);
                    100:                signal(SIGHUP, SIG_IGN);
                    101:                signal(SIGQUIT, SIG_IGN);
                    102:                signal(SIGKILL, SIG_IGN);
                    103:                sprintf(text, "%s -r %s", UUCP, str);
                    104:                execl(SHELL, "sh", "-c", text, CNULL);
                    105:                exit(100);
                    106:        }
                    107:        sleep(15);      /* Give uucp chance to finish */
                    108: }

unix.superglobalmegacorp.com

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