提交 eb08a103 编写于 作者: E Enrico Giordani

[Fix] Reporting the error code if listen() fails.

上级 d61c0974
......@@ -853,10 +853,14 @@ int FDAPI_listen(int rfd, int backlog) {
SOCKET socket = RFDMap::getInstance().lookupSocket(rfd);
if (socket != INVALID_SOCKET) {
EnableFastLoopback(socket);
return f_listen(socket, backlog);
int result = f_listen(socket, backlog);
if (result != 0){
errno = f_WSAGetLastError();
}
return result;
} else {
errno = EBADF;
return 0;
return -1;
}
} CATCH_AND_REPORT();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册