113699Ssam #ifndef lint 2*34177Srick static char sccsid[] = "@(#)xqt.c 5.4 (Berkeley) 05/04/88"; 313699Ssam #endif 413699Ssam 523694Sbloom #include <signal.h> 613699Ssam #include "uucp.h" 713699Ssam 817847Sralph int LocalOnly = 0; 917847Sralph 1023694Sbloom /*LINTLIBRARY*/ 1123694Sbloom 1217847Sralph /* 1317847Sralph * start up uucico for rmtname 1413699Ssam * 1513699Ssam * return codes: none 1613699Ssam */ 1713699Ssam 1817847Sralph #ifdef VMS 1917847Sralph #define fork vfork 2017847Sralph #endif VMS 2117847Sralph 2213699Ssam xuucico(rmtname) 2313699Ssam char *rmtname; 2413699Ssam { 2513699Ssam if (fork() == 0) { 2613699Ssam /* start uucico for rmtname system */ 2713699Ssam char opt[100]; 2813699Ssam close(0); 2913699Ssam close(1); 3013699Ssam close(2); 3117847Sralph open(DEVNULL, 0); 3217847Sralph open(DEVNULL, 1); 3317847Sralph open(DEVNULL, 1); 3413699Ssam signal(SIGINT, SIG_IGN); 3513699Ssam signal(SIGHUP, SIG_IGN); 3613699Ssam signal(SIGQUIT, SIG_IGN); 3713699Ssam signal(SIGKILL, SIG_IGN); 3813699Ssam if (rmtname[0] != '\0') 3923694Sbloom sprintf(opt, "-s%s", rmtname); 4013699Ssam else 4113699Ssam opt[0] = '\0'; 4217847Sralph #ifndef VMS 4317847Sralph if (LocalOnly) 4417847Sralph execl(UUCICO, "uucico", "-r1", "-L", opt, (char *)0); 4517847Sralph else 4617847Sralph execl(UUCICO, "uucico", "-r1", opt, (char *)0); 4717847Sralph #else VMS 4817847Sralph /* Under VMS/EUNICE release the batch job */ 4917847Sralph if (LocalOnly) 5017847Sralph execl(STARTUUCP, "startuucp", "uucico", "-r1", "-L", opt, (char *)0); 5117847Sralph else 5217847Sralph execl(STARTUUCP, "startuucp", "uucico", "-r1", opt, (char *)0); 5317847Sralph #endif VMS 5413699Ssam exit(100); 5513699Ssam } 5617847Sralph #ifdef VMS 5717847Sralph while(wait(0) != -1) 5817847Sralph ; /* Wait for it to finish!! */ 5917847Sralph #endif VMS 6013699Ssam return; 6113699Ssam } 6213699Ssam 6317847Sralph /* 6417847Sralph * start up uuxqt 6513699Ssam * 6613699Ssam * return codes: none 6713699Ssam */ 6813699Ssam xuuxqt() 6913699Ssam { 7013699Ssam if (fork() == 0) { 7113699Ssam /* start uuxqt */ 7213699Ssam close(0); 7313699Ssam close(1); 7413699Ssam close(2); 7517847Sralph open(DEVNULL, 2); 7617847Sralph open(DEVNULL, 2); 7717847Sralph open(DEVNULL, 2); 7813699Ssam signal(SIGINT, SIG_IGN); 7913699Ssam signal(SIGHUP, SIG_IGN); 8013699Ssam signal(SIGQUIT, SIG_IGN); 8113699Ssam signal(SIGKILL, SIG_IGN); 82*34177Srick execl(UUXQT, "uuxqt", (char *)0); 8313699Ssam exit(100); 8413699Ssam } 8513699Ssam } 8617847Sralph 8713699Ssam xuucp(str) 8813699Ssam char *str; 8913699Ssam { 9013699Ssam char text[300]; 9113699Ssam if (fork() == 0) { 9213699Ssam /* start uucp */ 9313699Ssam close(0); 9413699Ssam close(1); 9513699Ssam close(2); 9617847Sralph open(DEVNULL, 0); 9717847Sralph open(DEVNULL, 1); 9817847Sralph open(DEVNULL, 1); 9913699Ssam signal(SIGINT, SIG_IGN); 10013699Ssam signal(SIGHUP, SIG_IGN); 10113699Ssam signal(SIGQUIT, SIG_IGN); 10213699Ssam signal(SIGKILL, SIG_IGN); 10313699Ssam sprintf(text, "%s -r %s", UUCP, str); 10417847Sralph execl(SHELL, "sh", "-c", text, CNULL); 10513699Ssam exit(100); 10613699Ssam } 10713699Ssam sleep(15); /* Give uucp chance to finish */ 10813699Ssam } 109