[5831] in Athena Bugs

home help back first fref pref prev next nref lref last post

kermit changes for pmax/ultrix

daemon@ATHENA.MIT.EDU (John T Kohl)
Fri Aug 24 11:20:57 1990

Date: Fri, 24 Aug 90 11:20:41 -0400
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

second patch is to deal with errors releasing the lock file when hanging
up rather than exiting kermit.

*** /tmp/,RCSt1008764	Fri Aug 24 11:18:09 1990
--- ckutio.c	Wed Aug  1 04:50:42 1990
***************
*** 53,59 ****
  char *ckxsys = " SUNOS 4.x";
  #else
  #ifdef ultrix
! char *ckxsys = " VAX/Ultrix";
  #else
  char *ckxsys = " 4.2 BSD";
  #endif /* ultrix */
--- 53,59 ----
  char *ckxsys = " SUNOS 4.x";
  #else
  #ifdef ultrix
! char *ckxsys = " Ultrix";
  #else
  char *ckxsys = " 4.2 BSD";
  #endif /* ultrix */
***************
*** 732,742 ****
--- 732,744 ----
  /*  T T C L O S  --  Close the TTY, releasing any lock.  */
  
  ttclos() {
+     debug(F101,"ttclos, ttyfd","",ttyfd);
      if (ttyfd < 0) return(0);           /* Wasn't open. */
  #ifdef ultrix
      ioctl(ttyfd, TIOCNCAR, NULL);
  #endif
      if (xlocal) {
+ 	debug(F000, "ttclos ttunlck()","",'.');
          if (ttunlck())                  /* Release uucp-style lock */
              fprintf(stderr,"Warning, problem releasing lock\n");
  
***************
*** 751,756 ****
--- 753,759 ----
  #ifndef XENIX
  #ifdef TIOCEXCL
  #ifdef TIOCNXCL
+     debug(F000, "ttclos TIOCNXCL","",'.');
      if (ioctl(ttyfd, TIOCNXCL, NULL) < 0)
          fprintf(stderr,"Warning, problem relinquishing exclusive access\n");
  #endif /* tiocnxcl */
***************
*** 784,789 ****
--- 787,793 ----
      int ttc_save;
  #endif
  
+     debug(F101, "tthang, ttyfd", "", ttyfd);
      if (ttyfd < 0) return(0);           /* Not open. */
  #ifdef aegis
      sio_$control((short)ttyfd, sio_$dtr, false, st);    /* DTR down */
***************
*** 795,802 ****
      msleep(500);                        /* For about 1/2 sec */
      ioctl(ttyfd,TIOCSDTR,0);            /* Restore DTR */
      ttc_save = fcntl(ttyfd,F_GETFL,0);	/* Get flags */
      close(ttyfd);			/* Close/reopen file descriptor */
!     if ((ttyfd = open(ttnmsv, ttc_save)) < 0) return(-1);
  #endif /* anybsd */
  #ifdef UXIII
  #ifdef HPUX   /* Hewlett Packard way of modem control  */
--- 799,829 ----
      msleep(500);                        /* For about 1/2 sec */
      ioctl(ttyfd,TIOCSDTR,0);            /* Restore DTR */
      ttc_save = fcntl(ttyfd,F_GETFL,0);	/* Get flags */
+ 
+ /* Relinquish exclusive access if we might have had it... */
+ #ifndef XENIX
+ #ifdef TIOCEXCL
+ #ifdef TIOCNXCL
+     debug(F000, "tthang TIOCNXCL","",'.');
+     if (ioctl(ttyfd, TIOCNXCL, NULL) < 0)
+         fprintf(stderr,"Warning, problem relinquishing exclusive access\n");
+ #endif /* tiocnxcl */
+ #endif /* tiocexcl */
+ #endif /* not xenix */
      close(ttyfd);			/* Close/reopen file descriptor */
! 
!     if ((ttyfd = open(ttnmsv, ttc_save)) < 0) {
! 	debug(F101,"tthang fail, errno","",errno);
! 	return(-1);
!     }
!     debug(F101,"tthang reopen, ttyfd","",ttyfd);
! #ifndef XENIX
! /* Xenix exclusive access prevents open(close(...)) from working... */
! #ifdef TIOCEXCL
!         if (ioctl(ttyfd,TIOCEXCL, NULL) < 0)
!             fprintf(stderr,"Warning, problem getting exclusive access\n");
! #endif /* tiocexcl */
! #endif /* xenix */
  #endif /* anybsd */
  #ifdef UXIII
  #ifdef HPUX   /* Hewlett Packard way of modem control  */
***************
*** 820,825 ****
--- 847,853 ----
  /* NOTE - The following #ifndef...#endif can be removed for SCO Xenix 2.1.3 */
  /* or later, but must keep for earlier versions, which can't do close/open. */
  
+ #ifndef ultrix
  #ifndef XENIX           /* xenix cannot do close/open when carrier drops */
                                  /* following corrects a PC/IX defficiency */
      ttc_save = fcntl(ttyfd,F_GETFL,0);
***************
*** 826,832 ****
--- 854,862 ----
      close(ttyfd);               /* close/reopen file descriptor */
      ttyfd = -1;                 /* in case reopen fails */
      if ((ttyfd = open(ttnmsv, ttc_save)) < 0) return(-1);
+     debug(F101,"tthang reopen2, ttyfd","",ttyfd);
  #endif /* not xenix */
+ #endif /* not ultrix */
      if (ioctl(ttyfd,TCSETAF,&ttraw) < 0) return(-1); /* un-do it */
  #endif /* uxiii */
  #endif /* hpux  */
*** /tmp/,RCSt1008764	Fri Aug 24 11:18:19 1990
--- ckufio.c	Tue Jul 31 09:50:01 1990
***************
*** 36,42 ****
  char *ckzsys = " SUNOS 4.x";
  #else
  #ifdef ultrix
! char *ckzsys = " VAX/Ultrix";
  #else
  char *ckzsys = " 4.2 BSD";
  #endif /* ultrix */
--- 36,42 ----
  char *ckzsys = " SUNOS 4.x";
  #else
  #ifdef ultrix
! char *ckzsys = " Ultrix";
  #else
  char *ckzsys = " 4.2 BSD";
  #endif /* ultrix */

home help back first fref pref prev next nref lref last post