hax: Fix setting of FD_CLOEXEC
commit8cf58a49f883f089e7d4b6e19acc987085d024fd
authorEric Blake <eblake@redhat.com>
Mon, 20 Apr 2020 17:53:07 +0000 (20 12:53 -0500)
committerEric Blake <eblake@redhat.com>
Mon, 13 Jul 2020 14:01:01 +0000 (13 09:01 -0500)
treefffad750f4fe2a9933b2365ccbaa9fef30daa6df
parent00d69986da83a74f6f5731c80f8dd09fde95d19a
hax: Fix setting of FD_CLOEXEC

Blindly setting FD_CLOEXEC without a read-modify-write will
inadvertently clear any other intentionally-set bits, such as a
proposed new bit for designating a fd that must behave in 32-bit mode.
Use our wrapper function instead of an incorrect hand-rolled version.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200420175309.75894-2-eblake@redhat.com>
Reviewed-by: Colin Xu <colin.xu@intel.com>
target/i386/hax-posix.c