Date: Wed, 26 Jan 2011 20:14:03 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/lib/libc/stdio freopen.c Message-ID: <201101262014.p0QKEQ4x044493@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2011-01-26 20:14:03 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_8)
lib/libc/stdio freopen.c
Log:
SVN rev 217899 on 2011-01-26 20:14:03Z by jhb
MFC 216334:
When reopening a stream backed by an open file descriptor, do not close
the existing file descriptor. Instead, let dup2() atomically close the
old file descriptor when assigning the newly opened file to the same
descriptor. This closes a race in a multithreaded application where a
concurrent open() could allocate the existing file descriptor in between
the calls to close() and dup2().
Revision Changes Path
1.21.2.2 +9 -12 src/lib/libc/stdio/freopen.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101262014.p0QKEQ4x044493>
