]> sourceware.org Git - newlib-cygwin.git/commit
cygwin: pread/pwrite: prevent EBADF error after fork()
authorChristian Franke <christian.franke@t-online.de>
Wed, 23 Oct 2024 09:44:34 +0000 (11:44 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 23 Oct 2024 09:56:59 +0000 (11:56 +0200)
commitbdd06f82a186a509256d1b3c2dd9282f4c96553f
tree4feab86aae041d093626af5faac89823837c1bb6
parent1b7c72fdcc4bde7520407d2d3364146f04fb8312
cygwin: pread/pwrite: prevent EBADF error after fork()

If the parent process has already used pread() or pwrite(), these
functions fail with EBADF if used on the inherited fd.  Ensure that
fix_after_fork() is called to invalidate the prw_handle.  This issue
has been detected by 'stress-ng --pseek 1'.

Fixes: c36cd56c548a ("* fhandler.cc (fhandler_base::open): Drop local create_options variable.")
Signed-off-by: Christian Franke <christian.franke@t-online.de>
winsup/cygwin/fhandler/disk_file.cc
winsup/cygwin/release/3.5.5
This page took 0.029255 seconds and 5 git commands to generate.