On 5/25/19 1:33 PM, Richard W.M. Jones wrote:
I also made the code a bit more robust about closing the socket
along
error paths.
---
generator/states-connect.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
assert (!h->sock);
assert (h->argv);
assert (h->argv[0]);
- if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0,
- sv) == -1) {
+ if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) {
Is it any easier to keep SOCK_NONBLOCK here and then clear O_NONBLOCK in
the child process? It may matter if we try to port to a system that
lacks SOCK_CLOEXEC (SOCK_NONBLOCK and SOCK_CLOEXEC were added at the
same time). But we can deal with portability when someone reports a
problem. For now the patch looks fine.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org