提交 f5bdd781 编写于 作者: P Peter Maydell 提交者: Michael Tokarev

gdbstub: Use qemu_set_cloexec()

Use the utility routine qemu_set_cloexec() rather than
manually calling fcntl(). This lets us drop the #ifndef _WIN32
guards and also means Coverity doesn't complain that we're
ignoring the fcntl error return (CID 1005665, CID 1005667).
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: NThomas Huth <thuth@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 d29eb678
......@@ -1828,9 +1828,7 @@ static void gdb_accept(void)
perror("accept");
return;
} else if (fd >= 0) {
#ifndef _WIN32
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
qemu_set_cloexec(fd);
break;
}
}
......@@ -1857,9 +1855,7 @@ static int gdbserver_open(int port)
perror("socket");
return -1;
}
#ifndef _WIN32
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
qemu_set_cloexec(fd);
socket_set_fast_reuse(fd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册