vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write
commit747ca4eb5fed5dd58a14391a997bb9e658e3b1c8
authorMark Wielaard <mark@klomp.org>
Tue, 12 Nov 2024 12:34:09 +0000 (12 13:34 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 12 Nov 2024 12:34:09 +0000 (12 13:34 +0100)
tree9d42902b914eb79658cb2301a8924cc6f6da8f05
parentf4fe5faf3d0f45b3824bbb9070232682df52a582
vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced another off-by-one issue trying to write
back the error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is when the child needs to do a chdir and that chdir fails. If
that happens the parent would have gotten the wrong error code.
coregrind/vgdb.c