diff --git a/net/basic_socket.cpp b/net/basic_socket.cpp index bd54f8fd..53d9d9d6 100644 --- a/net/basic_socket.cpp +++ b/net/basic_socket.cpp @@ -99,7 +99,7 @@ int connect(int fd, const struct sockaddr *addr, socklen_t addrlen, ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &n); if (ret < 0) return -1; if (err) { - errno = err; + errno = e; return -1; } return 0;