Subject: Patch to getty_ps2.0.7b for linux 0.99.15
From: [email-masked] (Kris Gleason)
Date: 18 Jan 1994 22:22:37 +0200
Newsgroups: comp.os.linux.announce

getty_ps 2.0.7c
-------------------

The upcoming release of 0.99.15 will break getty_ps version 2.0.7b.

If you are using this package, please apply the following patch
to your sources, and recompile your binaries.  This patch will 
bring your sources up to version 2.0.7c.

The patches fix a vhangup() bug that has gone unnoticed for nearly
a year.  They also support EAGAIN returned from open() as per the
new version of the serial driver.

This release does not address any other problems with getty_ps.  It
is provided to allow compatibility with the new kernel.

A new release of getty_ps is in the works.  The new release will
support receiving faxes, logging via syslog, a few other new
features, and lots of bug fixes.
It should be out in a month or so.

Kris Gleason
[email-masked]

--
Enclosed File: diff-207b-207c; sum reports: 28831     3
BEGIN-----------8<---------CUT HERE---------8<---------------
*** ../getty_ps2.0.7b/main.c	Tue Apr 20 16:51:44 1993
--- main.c	Mon Jan 10 22:01:53 1994
***************
*** 495,500 ****
--- 495,528 ----
  #endif /* LOGUTMP */

+ /* vhangup() goes _here_ not where it was
+ */
+ 
+ 	debug3(D_RUN, "calling vhangup() on %s\n", devname);
+ 	while ((fd = open(devname, O_RDWR | O_NDELAY)) < 0) {
+ 		if(errno == EBUSY)
+ 		  sleep(30);
+ 		else if(errno != EAGAIN) {
+ 		  logerr("couldn't open line to vhangup");
+ 		  exit(FAIL);
+ 		}
+ 	}
+ 	ioctl(fd, TIOCSCTTY, 1);
+ 	gtab = gtabvalue(GtabId, G_FORCE);
+ 	if(! NoHangUp) {
+ 		(void) ioctl(STDIN, TCGETS, &termio);
+ 		termio.c_cflag &= ~CBAUD;
+ 		termio.c_cflag |= B0;
+ 		(void) ioctl(STDIN, TCSETSF, &termio);
+ 		sleep(2);
+ 	}
+ 	settermio(&(gtab->itermio), INITIAL);
+ 	ioctl(fd, TCSETS, &termio);
+ 	signal(SIGHUP, SIG_IGN);
+ 	vhangup();
+ 	signal(SIGHUP, shangup);
+ 	close(fd);
+ 
  
  /* now, the init device is opened ONLY if INIT or WAITCHAR is requested
  */
***************
*** 501,511 ****
  
  	if((init) || (waitchar)) {
  		debug3(D_RUN, "opening init line: %s\n", initdevname);
! 		while(((fd = open(initdevname, O_RDWR | O_NDELAY)) < 0) &&
! 		  (errno == EBUSY)) sleep(30);
! 		if(fd < 0) {
! 			logerr("cannot open init line");
! 			exit(FAIL);
  		}
  		if(fd != 0) {
  			logerr("cannot open init stdin");
--- 529,541 ----
  
  	if((init) || (waitchar)) {
  		debug3(D_RUN, "opening init line: %s\n", initdevname);
! 		while((fd = open(initdevname, O_RDWR | O_NDELAY)) < 0) {
! 			if(errno == EBUSY)
! 			  sleep(30);
! 			else if(errno != EAGAIN) {
! 			  logerr("cannot open init line");
! 			  exit(FAIL);
! 			}
  		}
  		if(fd != 0) {
  			logerr("cannot open init stdin");
***************
*** 524,538 ****
  		setbuf(stdout, (char *) NULL);
  		setbuf(stderr, (char *) NULL);
  
- 		gtab = gtabvalue(GtabId, G_FORCE);
- 		if(! NoHangUp) {
- 			(void) ioctl(STDIN, TCGETS, &termio);
- 			termio.c_cflag &= ~CBAUD;
- 			termio.c_cflag |= B0;
- 			(void) ioctl(STDIN, TCSETSF, &termio);
- 			sleep(2);
- 		}
- 		settermio(&(gtab->itermio), INITIAL);
  
  		flags = fcntl(STDIN, F_GETFL, 0);
  		(void) fcntl(STDIN, F_SETFL, flags & ~O_NDELAY);
--- 554,559 ----
***************
*** 698,707 ****
  	debug3(D_RUN, "opening line: %s\n", devname);
  
  	if((fd = open(devname, (waitfor) ? 
! 	  (O_RDWR | O_NDELAY) : (O_RDWR))) < 0) {
! 		logerr("cannot open connect line");
! 		exit(FAIL);
! 	}
  	if(fd != 0) {
  		logerr("cannot open connect stdin");
  		exit(FAIL);
--- 719,731 ----
  	debug3(D_RUN, "opening line: %s\n", devname);
  
  	if((fd = open(devname, (waitfor) ? 
! 	  (O_RDWR | O_NDELAY) : (O_RDWR))) < 0)
! 		if(errno == EAGAIN)
! 		  exit(0);
! 		else {
! 			logerr("cannot open connect line");
! 			exit(FAIL);
! 		}
  	if(fd != 0) {
  		logerr("cannot open connect stdin");
  		exit(FAIL);
***************
*** 714,719 ****
--- 738,745 ----
  		logerr("cannot open connect stderr");
  		exit(FAIL);
  	}
+ 
+ 	ioctl(fd, TIOCSCTTY, 1);
  
  #ifdef UUGETTY
  /* stop looking for lockfiles now
END-------------8<---------CUT HERE---------8<---------------

--
Mail submissions for comp.os.linux.announce to: [email-masked]
PLEASE remember Keywords: and a short description of the software.