Subject: CVS commit: [netbsd-2] src/sys/kern
To: None <source-changes@NetBSD.org>
From: Matthias Scheler <firstname.lastname@example.org>
Date: 03/16/2005 11:38:59
Module Name: src
Committed By: tron
Date: Wed Mar 16 11:38:59 UTC 2005
src/sys/kern [netbsd-2]: kern_descrip.c
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 -r126.96.36.199 -r188.8.131.52.2.1 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.