After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612397 - [multiudpsink] [PATCH] Fix print of socket's error code on Windows
[multiudpsink] [PATCH] Fix print of socket's error code on Windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Windows
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-10 09:21 UTC by Andoni Morales
Modified: 2010-03-10 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-multiudpsink-Fix-print-of-socket-s-errorcode-on-Win3.patch (940 bytes, patch)
2010-03-10 09:21 UTC, Andoni Morales
none Details | Review

Description Andoni Morales 2010-03-10 09:21:09 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
Comment 1 Andoni Morales 2010-03-10 09:46:19 UTC
> 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
Comment 2 Michael Smith 2010-03-10 18:27:31 UTC
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.
Comment 3 Michael Smith 2010-03-10 18:56:16 UTC
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.