mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
12c09b8ce2
commit
40ff6d7e8d
20 changed files with 178 additions and 34 deletions
|
@ -302,7 +302,7 @@ int udp_output(struct socket *so, struct mbuf *m,
|
|||
int
|
||||
udp_attach(struct socket *so)
|
||||
{
|
||||
if((so->s = socket(AF_INET,SOCK_DGRAM,0)) != -1) {
|
||||
if((so->s = qemu_socket(AF_INET,SOCK_DGRAM,0)) != -1) {
|
||||
so->so_expire = curtime + SO_EXPIRE;
|
||||
insque(so, &so->slirp->udb);
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ udp_listen(Slirp *slirp, u_int32_t haddr, u_int hport, u_int32_t laddr,
|
|||
if (!so) {
|
||||
return NULL;
|
||||
}
|
||||
so->s = socket(AF_INET,SOCK_DGRAM,0);
|
||||
so->s = qemu_socket(AF_INET,SOCK_DGRAM,0);
|
||||
so->so_expire = curtime + SO_EXPIRE;
|
||||
insque(so, &slirp->udb);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue