Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 20:14:12 +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.p0QKEWCS044512@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2011-01-26 20:14:12 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    lib/libc/stdio       freopen.c 
  Log:
  SVN rev 217900 on 2011-01-26 20:14:12Z 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.18.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.p0QKEWCS044512>