Update of bug #18210 (project freeciv):
Planned Release: 2.3.1, 2.4.0 => 2.3.0, 2.4.0
Follow-up Comment #3:
Actually this weird design may work, don't know enough about Windows to say
for sure. set_socket_errno() related errno value is used to things unrelated
to what fc_get_errno() values are used for. At least in stable branch I would
leave basic desing as it is until someone reports real problem with it.
I did found something to improve in set_socket_errno() though. Attached
- Call WSAGetLastError() only once.
- Set errno to 0 when there's no errno mapping. Old behavior of not touching
errno at all in that case could cause bugs. If errno had been already set to
some error value by earlier callers, and we leave it to that value, callers
who know (or assume, since it was true because this bug) by some socket
function return value that errno has been set to indicate error of that
function call would use wrong errno value.
I may post S2_2 version of the patch later. Current one does not apply there.
Additional Item Attachment:
File name: SetSockErr_18210.diff Size:1 KB
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list