date and time created 86/04/03 16:50:58 by donn
[unix-history] / usr / src / usr.bin / tip / aculib / dn11.c
index 0ccd9b2..2a9553a 100644 (file)
@@ -1,22 +1,24 @@
-/*     dn11.c  4.8     81/08/24        */
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)dn11.c     5.1 (Berkeley) %G%";
+#endif not lint
 
 
-#if DN11
 /*
  * Routines for dialing up on DN-11
  */
 #include "tip.h"
 /*
  * Routines for dialing up on DN-11
  */
 #include "tip.h"
-#include <setjmp.h>
-#include <errno.h>
-
-int dn_abort();
-
-int alarmtr();
 
 
+int dn_abort(), alarmtr();
 static jmp_buf jmpbuf;
 static int child = -1, dn;
 
 dn_dialer(num, acu)
 static jmp_buf jmpbuf;
 static int child = -1, dn;
 
 dn_dialer(num, acu)
-char *num, *acu;
+       char *num, *acu;
 {
        extern errno;
        char *p, *q, phone[40];
 {
        extern errno;
        char *p, *q, phone[40];
@@ -30,12 +32,12 @@ char *num, *acu;
                        printf("line busy...");
                else
                        printf("acu open error...");
                        printf("line busy...");
                else
                        printf("acu open error...");
-               return(0);
+               return (0);
        }
        if (setjmp(jmpbuf)) {
                kill(child, SIGKILL);
                close(dn);
        }
        if (setjmp(jmpbuf)) {
                kill(child, SIGKILL);
                close(dn);
-               return(0);
+               return (0);
        }
        signal(SIGALRM, alarmtr);
        timelim = 5 * strlen(num);
        }
        signal(SIGALRM, alarmtr);
        timelim = 5 * strlen(num);
@@ -62,24 +64,25 @@ char *num, *acu;
                alarm(0);
                kill(child, SIGKILL);
                close(dn);
                alarm(0);
                kill(child, SIGKILL);
                close(dn);
-               return(0);
+               return (0);
        }
        }
+       alarm(0);
        ioctl(dn, TIOCHPCL, 0);
        signal(SIGALRM, SIG_DFL);
        while ((nw = wait(&lt)) != child && nw != -1)
                ;
        ioctl(dn, TIOCHPCL, 0);
        signal(SIGALRM, SIG_DFL);
        while ((nw = wait(&lt)) != child && nw != -1)
                ;
-       alarm(0);
        fflush(stdout);
        close(dn);
        if (lt != 0) {
                close(FD);
        fflush(stdout);
        close(dn);
        if (lt != 0) {
                close(FD);
-               return(0);
+               return (0);
        }
        }
-       return(1);
+       return (1);
 }
 
 alarmtr()
 {
 }
 
 alarmtr()
 {
+
        alarm(0);
        longjmp(jmpbuf, 1);
 }
        alarm(0);
        longjmp(jmpbuf, 1);
 }
@@ -90,25 +93,22 @@ alarmtr()
  */
 dn_disconnect()
 {
  */
 dn_disconnect()
 {
+
        sleep(2);
        sleep(2);
-#ifdef VMUNIX
        if (FD > 0)
                ioctl(FD, TIOCCDTR, 0);
        if (FD > 0)
                ioctl(FD, TIOCCDTR, 0);
-#endif
        close(FD);
 }
 
 dn_abort()
 {
        close(FD);
 }
 
 dn_abort()
 {
+
        sleep(2);
        if (child > 0)
                kill(child, SIGKILL);
        if (dn > 0)
                close(dn);
        sleep(2);
        if (child > 0)
                kill(child, SIGKILL);
        if (dn > 0)
                close(dn);
-#ifdef VMUNIX
        if (FD > 0)
                ioctl(FD, TIOCCDTR, 0);
        if (FD > 0)
                ioctl(FD, TIOCCDTR, 0);
-#endif
        close(FD);
 }
        close(FD);
 }
-#endif