cvs commit: src/lib/libc_r/uthread uthread_close.c
Ruslan Ermilov
ru at FreeBSD.org
Fri May 30 22:20:46 PDT 2003
ru 2003/05/30 22:20:44 PDT
FreeBSD src repository
Modified files:
lib/libc_r/uthread uthread_close.c
Log:
If an application closes one of its stdio descriptors (0..2),
an excessive close() on one of these descriptors would cause
a memory for this descriptor to be allocated in the internal
descriptor table. When this descriptor gets used again, e.g.
through the call to open() or socket(), the descriptor would
be erroneously left in the blocking mode, and the whole
application would get stuck on a blocking operation, e.g.,
in accept(2).
Prevent this bug from happening by disallowing close() against
non-active descriptors (return -1 and set errno to EBADF in
this case).
Reviewed by: deischen
Approved by: re (scottl)
Revision Changes Path
1.14 +4 -2 src/lib/libc_r/uthread/uthread_close.c
More information about the cvs-src
mailing list