Date: Fri, 30 May 2003 22:20:44 -0700 (PDT) From: Ruslan Ermilov <ru@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc_r/uthread uthread_close.c Message-ID: <200305310520.h4V5Kjfr008748@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305310520.h4V5Kjfr008748>