aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-03-10 17:07:27 +0000
committerDaniel P. Berrange <berrange@redhat.com>2016-03-10 17:11:40 +0000
commitde7971ffb9a1ac85cbcc12f5380f44d31ed182e6 (patch)
treea7d0c9ffd6a3f88e62184d3c2d5d09f3e1bbcf4b /io
parentb83b68a0132f43f3ebcb61c9237ec1090da58894 (diff)
io: use qemu_accept to ensure SOCK_CLOEXEC is set
The QIOChannelSocket code mistakenly uses the bare accept() function which does not set SOCK_CLOEXEC. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'io')
-rw-r--r--io/channel-socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 775bb9fcbc..9b5f2d8887 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -343,8 +343,8 @@ qio_channel_socket_accept(QIOChannelSocket *ioc,
retry:
trace_qio_channel_socket_accept(ioc);
- cioc->fd = accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr,
- &cioc->remoteAddrLen);
+ cioc->fd = qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr,
+ &cioc->remoteAddrLen);
if (cioc->fd < 0) {
trace_qio_channel_socket_accept_fail(ioc);
if (socket_error() == EINTR) {