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
patch:
- 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.

(file #13291)
    _______________________________________________________

Additional Item Attachment:

File name: SetSockErr_18210.diff          Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?18210>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to