summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-07 11:04:32 +0200
committerAvi Kivity <avi@redhat.com>2009-12-07 11:04:32 +0200
commit149d76049af52aa76f4665b6bc9bdbd5904a8588 (patch)
treee07c6dfe28f03438dff9bb07240a7534c010f990 /gdbstub.c
parentMerge commit 'e9b2e81889d9877415710484b876ee57a42b0bcb' into upstream-merge (diff)
parentDon't leak file descriptors (diff)
downloadqemu-kvm-149d76049af52aa76f4665b6bc9bdbd5904a8588.tar.gz
qemu-kvm-149d76049af52aa76f4665b6bc9bdbd5904a8588.tar.bz2
qemu-kvm-149d76049af52aa76f4665b6bc9bdbd5904a8588.zip
Merge commit '40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4' into upstream-merge
* commit '40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4': Don't leak file descriptors qemu-img: There is more than one host device driver qcow2: Fix some more qemu_malloc fallout qcow2: Store exact backing format length virtio-blk: Implement rerror option ide: Implement rerror option Conflicts: posix-aio-compat.c Extended qemu_set_cloexec() to compatfd.c. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index ad7cdca85..b1c55d8a4 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2357,6 +2357,9 @@ static void gdb_accept(void)
perror("accept");
return;
} else if (fd >= 0) {
+#ifndef _WIN32
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
break;
}
}
@@ -2386,6 +2389,9 @@ static int gdbserver_open(int port)
perror("socket");
return -1;
}
+#ifndef _WIN32
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
/* allow fast reuse */
val = 1;