SOCK: Remove duplicate nonblocking code in sim_connect_sock_ex

This commit is contained in:
Mark Pizzolato 2020-04-11 13:04:53 -07:00
parent 35780cf5e2
commit 6af7a8a434

View file

@ -688,7 +688,7 @@ return 0;
port = pointer to buffer for IP port (may be NULL), 0 = none port = pointer to buffer for IP port (may be NULL), 0 = none
localport localport
= pointer to buffer for local IP port (may be NULL), 0 = none = pointer to buffer for local IP port (may be NULL), 0 = none
result = status (SCPE_OK on complete success or SCPE_ARG if result = status (0 on complete success or -1 if
parsing can't happen due to bad syntax, a value is parsing can't happen due to bad syntax, a value is
out of range, a result can't fit into a result buffer, out of range, a result can't fit into a result buffer,
a service name doesn't exist, or a validation name a service name doesn't exist, or a validation name
@ -1018,11 +1018,6 @@ if (!(opt_flags & SIM_SOCK_OPT_DATAGRAM)) {
if (sta == -1) if (sta == -1)
return sim_err_sock (newsock, "setsockopt KEEPALIVE"); return sim_err_sock (newsock, "setsockopt KEEPALIVE");
} }
if (!(opt_flags & SIM_SOCK_OPT_BLOCKING)) {
sta = sim_setnonblock (newsock); /* set nonblocking */
if (sta == SOCKET_ERROR) /* fcntl error? */
return sim_err_sock (newsock, "setnonblock");
}
sta = connect (newsock, result->ai_addr, result->ai_addrlen); sta = connect (newsock, result->ai_addr, result->ai_addrlen);
p_freeaddrinfo (result); p_freeaddrinfo (result);
if (sta == SOCKET_ERROR) { if (sta == SOCKET_ERROR) {