X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=gdbstub.c;h=5a4f7d49b9fa43468c756698f7738abd0fabd1fe;hb=40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4;hp=055093f89ba39a04a0841eb3b932b84c659d265b;hpb=12c09b8ce22d74f78ff50f95676cbe4f501752ae;p=qemu.git diff --git a/gdbstub.c b/gdbstub.c index 055093f89..5a4f7d49b 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2356,6 +2356,9 @@ static void gdb_accept(void) perror("accept"); return; } else if (fd >= 0) { +#ifndef _WIN32 + fcntl(fd, F_SETFD, FD_CLOEXEC); +#endif break; } } @@ -2385,6 +2388,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;