]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Follow up to rev 13944
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 5 Jul 2014 18:43:24 +0000 (18:43 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 5 Jul 2014 18:43:24 +0000 (18:43 +0000)
commitbe2e8b2a80c49c174bd0445fa1078b48fa3fddc1
tree7cd15cb201625233dd1aae4ba9522a2130e7dc34
parent2c502a3da6c7fc907e6a3c01e9fe852814f7710a
Follow up to rev  13944
13944 objective was to avoid having a vgdb that connects to a just forked child
that would have the FIFO still opened, while its parent would close it.

However, in case a previous vgdb closed the FIFO, the read FIFO in the parent
is put in 'eof status' by the kernel. So, readchar will then return eof
in the parent unless another vgdb re-opens the FIFO in write.
So, gdbsrv does not stop anymore on error if needed, due to this readchar
giving eof.

The only way to reset this eof condition is to close the fd.
But we must always have the FIFO open (to avoid the race condition that
rev 13944 fixed)
=> in case of error, first re-open the FIFO, before closing the (previous)
FIFO fd (which is in eof state and cannot be properly used anymore).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14134
coregrind/m_gdbserver/remote-utils.c