Subject: Re: PR/32682 CVS commit: src/sys/kern
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Hauke Fath <hf@spg.tu-darmstadt.de>
List: netbsd-bugs
Date: 09/22/2006 17:00:04
The following reply was made to PR kern/32682; it has been noted by GNATS.

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	Christos Zoulas <christos@NetBSD.org>
Subject: Re: PR/32682 CVS commit: src/sys/kern
Date: Fri, 22 Sep 2006 18:55:43 +0200

 Am 22.09.2006 um 15:20 Uhr +0000 schrieb Christos Zoulas:
 >  Modified Files:
 >  	src/sys/kern: tty_ptm.c
 
 Cool...
 
 I have applied
 
 Index: tty_ptm.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/tty_ptm.c,v
 retrieving revision 1.4
 diff -u -r1.4 tty_ptm.c
 --- tty_ptm.c	30 Nov 2004 04:25:44 -0000	1.4
 +++ tty_ptm.c	22 Sep 2006 16:36:10 -0000
 @@ -337,8 +337,24 @@
 
   	switch(minor(dev)) {
   	case 0:		/* /dev/ptmx */
 +	case 2:		/* /emul/linux/dev/ptmx */
   		if ((error = pty_alloc_master(p, &fd, &dev)) != 0)
   			return error;
 +		if (minor(dev) == 2) {
 +			/*
 +			 * Linux ptyfs grants the pty right here.
 +			 * Handle this case here, instead of writing
 +			 * a new linux module.
 +			 */
 +			if ((error = pty_grant_slave(p, dev)) != 0) {
 +				struct file *fp =
 +				    fd_getfile(p->p_fd, fd);
 +				FILE_UNUSE(fp, p);
 +				fdremove(p->p_fd, fd);
 +				ffree(fp);
 +				return error;
 +			}
 +		}
   		curlwp->l_dupfd = fd;
   		return EMOVEFD;
   	case 1:		/* /dev/ptm */
 @@ -384,6 +400,7 @@
   	}
   bad:
   	fp = fd_getfile(p->p_fd, cfd);
 +	FILE_UNUSE(fp, p);
   	fdremove(p->p_fd, cfd);
   	ffree(fp);
   	return error;
 
 
 to my netbsd-3 source tree and built a kernel that will be on the lab 
 machines tomorrow. I should have feedback early next week...
 
 	hauke
 
 -- 
 /~\  The ASCII Ribbon Campaign                    Hauke Fath
 \ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
   X     No Word docs in email	                  TU Darmstadt
 / \  Respect for open standards              Ruf +49-6151-16-3281