Replace sleep calls for 'wake up'.
[unix-history] / usr / src / usr.bin / tip / aculib / dn11.c
index 7446f5b..091ff51 100644 (file)
@@ -1,22 +1,18 @@
-/*     dn11.c  4.6     81/07/11        */
+#ifndef lint
+static char sccsid[] = "@(#)dn11.c     4.14 (Berkeley) %G%";
+#endif
 
 
-#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 +26,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,27 +58,26 @@ 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);
        fflush(stdout);
+       close(dn);
        if (lt != 0) {
                close(FD);
        if (lt != 0) {
                close(FD);
-               close(dn);
-               return(0);
+               return (0);
        }
        }
-       return(1);
+       return (1);
 }
 
 alarmtr()
 {
 }
 
 alarmtr()
 {
+
        alarm(0);
        alarm(0);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
        longjmp(jmpbuf, 1);
 }
 
        longjmp(jmpbuf, 1);
 }
 
@@ -92,25 +87,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