Subject: Re: CVS commit: src/usr.bin/tip
To: Thor Lancelot Simon <tls@NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: source-changes
Date: 04/03/2006 10:36:45
On Mon, Apr 03, 2006 at 05:57:27AM +0000, Thor Lancelot Simon wrote:
> [...]
> I think the attached should suffice for pppd.  Do you agree?
> 
> Thor

> Index: tty.c
> ===================================================================
> RCS file: /cvsroot/src/dist/pppd/pppd/tty.c,v
> retrieving revision 1.2
> diff -c -r1.2 tty.c
> *** tty.c	20 Feb 2005 10:47:17 -0000	1.2
> --- tty.c	3 Apr 2006 05:50:58 -0000
> ***************
> *** 588,593 ****
> --- 588,600 ----
>   				goto errret;
>   		}
>   		ttyfd = real_ttyfd;
> + 		if (lockflag) 
> + 			if(flock(ttyfd, (LOCK_EX|LOCK_NB)) != 0) {
> + 				status = EXIT_LOCK_FAILED;
> + 				close(ttyfd);
> + 				goto errret;
> + 			}

This won't work if the device in on a NFS filesystem

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--