GNOME Bugzilla – Bug 612397
[multiudpsink] [PATCH] Fix print of socket's error code on Windows
Last modified: 2010-03-10 18:56:16 UTC
Created attachment 155707 [details] [review] 0001-multiudpsink-Fix-print-of-socket-s-errorcode-on-Win3.patch Although it's seems quite unbelievable, WSAGetLastError() returns always 0 after g_convert() (nultiudpsink:is called. I used one print before which actually outputs the 10022 error code and another after which returns 0. Resetting the last error with WSASetLastError() fix it and the errorcode is printed properly
> after g_convert() (nultiudpsink:is called. I used one print before which after g_convert()(multiudpsink.c:414) is called. I used one print before which
That makes sense - on windows these days WSAGetLastError() is actually just a thin wrapper around GetLastError, I think. So the code in g_convert() can override that because it calls other things that set the windows error code. I'll push this patch with a comment explaining.
commit 2eb651d46fb60bb9fb1929c07e4b901baa73c189 Author: Andoni Morales Alastruey <amorales@flumotion.com> Date: Wed Mar 10 10:51:28 2010 -0800 multiudpsink: Reset windows error code after getting corresponding error message.