Two fixes for pseudo-ttys

Michael Ellis ellis at flairvax.UUCP
Tue Jul 17 15:28:45 AEST 1984


In april, jim at haring sent out a fix to tty_pty.c (article 235 at haring) to
correct slave-end tty close snafus, as well as the awful EOF problem.

I finally got around to installing his fixes to tty_pty.c, but was 
suspicious that his original article had been truncated when I noticed how
abruptly it ended, as below:


--- 338,349 -----
  			break;
  		iov = uio->uio_iov;
  		if (iov->iov_len == 0) {
+ 			while((pti->pt_flags&PF_REMOTE) && tp->t_rawq.c_cc != 0)
+ 				sleep((caddr_t)&tp->t_rawq.c_cf, TTIPRI);
+ 			if(pti->pt_flags&PF_REMOTE){
+ 				(void) putc(0, &tp->t_rawq);
+ 				wakeup((caddr_t)&tp->t_rawq);
+ 			}
  			uio->uio_iovcnt--;	
  			uio->uio_iov++;
  			if (uio->uio_iovcnt < 0)
<-end of article "235 at haring"

Furthermore, installing the fix as received resulted in awful screwups
to most programs that depend on pty's, though the EOF problem indeed
was cured.

Can anybody verify that we have indeed lost a portion of Jim's article?
If so, can anybody supply the correct fix?

-michael



More information about the Comp.bugs.4bsd.ucb-fixes mailing list