Subject: PR/28929 CVS commit: [netbsd-2-0] src/sys/kern
To: None <cube@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Matthias Scheler <tron@netbsd.org>
List: netbsd-bugs
Date: 03/16/2005 11:39:01
The following reply was made to PR kern/28929; it has been noted by GNATS.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/28929 CVS commit: [netbsd-2-0] src/sys/kern
Date: Wed, 16 Mar 2005 11:38:29 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Wed Mar 16 11:38:28 UTC 2005
Modified Files:
src/sys/kern [netbsd-2-0]: kern_descrip.c
Log Message:
Pull up revision 1.128 via patch (requested by cube in ticket #1089):
fd_lastfile should be -1 when there are no opened file descriptors.
Hence, make find_last_set return -1 in such situation, and initialize it
such. Otherwise, with 0 meaning two things, it confused the F_CLOSEM
fcntl which could end up looping indifintely (PR#28929 by Brian Marcotte).
However, this change enlightens another bug in fdcopy(), where more entries
than needed were cleared in the new file descriptor table, so the memset()
call there is fixed too.
Analyzed with the help of Greg Oster.
To generate a diff of this commit:
cvs rdiff -r1.123.2.1 -r1.123.2.2 src/sys/kern/kern_descrip.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.