date and time created 83/07/02 17:58:11 by sam
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 3 Jul 1983 08:58:11 +0000 (00:58 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 3 Jul 1983 08:58:11 +0000 (00:58 -0800)
SCCS-vsn: usr.bin/uucp/libuu/xqt.c 5.1

usr/src/usr.bin/uucp/libuu/xqt.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/uucp/libuu/xqt.c b/usr/src/usr.bin/uucp/libuu/xqt.c
new file mode 100644 (file)
index 0000000..882ded7
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef lint
+static char sccsid[] = "@(#)xqt.c      5.1 (Berkeley) %G%";
+#endif
+
+#include "uucp.h"
+#include <signal.h>
+
+/*******
+ *     xuucico(rmtname)                start up uucico for rmtname
+ *     char *rmtname;
+ *
+ *     return codes:  none
+ */
+
+xuucico(rmtname)
+char *rmtname;
+{
+       if (fork() == 0) {
+               /*  start uucico for rmtname system  */
+               char opt[100];
+               close(0);
+               close(1);
+               close(2);
+               open("/dev/null", 0);
+               open("/dev/null", 1);
+               open("/dev/null", 1);
+               signal(SIGINT, SIG_IGN);
+               signal(SIGHUP, SIG_IGN);
+               signal(SIGQUIT, SIG_IGN);
+               signal(SIGKILL, SIG_IGN);
+               if (rmtname[0] != '\0')
+                       sprintf(opt, "-s%.7s", rmtname);
+               else
+                       opt[0] = '\0';
+               execl(UUCICO, "UUCICO", "-r1", opt, (char *)0);
+               exit(100);
+       }
+       return;
+}
+
+
+/*******
+ *     xuuxqt()                start up uuxqt
+ *
+ *     return codes:  none
+ */
+
+xuuxqt()
+{
+       if (fork() == 0) {
+               /*  start uuxqt  */
+               close(0);
+               close(1);
+               close(2);
+               open("/dev/null", 2);
+               open("/dev/null", 2);
+               open("/dev/null", 2);
+               signal(SIGINT, SIG_IGN);
+               signal(SIGHUP, SIG_IGN);
+               signal(SIGQUIT, SIG_IGN);
+               signal(SIGKILL, SIG_IGN);
+               execl(UUXQT, "UUXQT",  (char *)0);
+               exit(100);
+       }
+       return;
+}
+xuucp(str)
+char *str;
+{
+       char text[300];
+       if (fork() == 0) {
+               /*  start uucp  */
+               close(0);
+               close(1);
+               close(2);
+               open("/dev/null", 0);
+               open("/dev/null", 1);
+               open("/dev/null", 1);
+               signal(SIGINT, SIG_IGN);
+               signal(SIGHUP, SIG_IGN);
+               signal(SIGQUIT, SIG_IGN);
+               signal(SIGKILL, SIG_IGN);
+               sprintf(text, "%s -r %s", UUCP, str);
+               execl(SHELL, "sh", "-c", text, (char *)0);
+               exit(100);
+       }
+       sleep(15);      /* Give uucp chance to finish */
+       return;
+}