[MLton] bug in MLton and bug in basis

Wesley W. Terpstra wesley@terpstra.ca
Thu, 18 Aug 2005 17:37:43 +0200


On Aug 18, 2005, at 5:13 PM, Florian Weimer wrote:
>>       if (getsockopt(fd->osfd, SOL_SOCKET, SO_ERROR, (char *)&err,
>>                      (socklen_t *)&n) < 0)
>>         return -1;
>>       if (err) {
>>         errno = err;
>>         return -1;
>>       }
>
> As far as I can see, this sets errno correctly both on Solaris and
> non-Solaris systems.  The logic is just reversed, compared to the code
> I posted.

Right. =)

For that matter, the patch I made to MLton has the side benefit
of already working on Solaris since it will think the getsockopt
call failed (it did this before too) and raise the exception. All my
patch does from this point of view, is bring things in line with the
Solaris approach... ;-) ie: raise also based on the value in &err.