diff options
author | Kevin Wolf <kwolf@redhat.com> | 2009-12-02 12:24:42 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 11:45:50 -0600 |
commit | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 (patch) | |
tree | 98d560a0de229f27a66f637cfcadbb1672e68cc3 /slirp/socket.c | |
parent | 12c09b8ce22d74f78ff50f95676cbe4f501752ae (diff) | |
download | qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.zip qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.tar.gz qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.tar.bz2 |
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/socket.c')
-rw-r--r-- | slirp/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/slirp/socket.c b/slirp/socket.c index 207109c..cf6e6a9 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -626,7 +626,7 @@ tcp_listen(Slirp *slirp, u_int32_t haddr, u_int hport, u_int32_t laddr, addr.sin_addr.s_addr = haddr; addr.sin_port = hport; - if (((s = socket(AF_INET,SOCK_STREAM,0)) < 0) || + if (((s = qemu_socket(AF_INET,SOCK_STREAM,0)) < 0) || (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) || (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) || (listen(s,1) < 0)) { |