_mosquitto_net_read must call WSASetLastError when changing errno so that the error code can be picked up by _mosquitto_packet_read

Signed-off-by: Thomas Beckmann (M-Way) <t.beckmann@mwaysolutions.com>
This commit is contained in:
Thomas Beckmann (M-Way) 2018-03-29 08:44:57 +02:00 committed by Roger A. Light
parent f2376551bc
commit 8e3c2d9af7

View File

@ -697,6 +697,9 @@ ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count)
net__print_ssl_error(mosq); net__print_ssl_error(mosq);
errno = EPROTO; errno = EPROTO;
} }
#ifdef WIN32
WSASetLastError(errno);
#endif
} }
return (ssize_t )ret; return (ssize_t )ret;
}else{ }else{