summaryrefslogtreecommitdiffstats
path: root/device_tree.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-03-07 11:19:18 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:49:36 -0600
commit7fc505e1d659c75faf568441b8827416c1cb65dd (patch)
treead0371f9b67dcd01466138630fda7706635b918d /device_tree.c
parentd2d7a2a37acbcf73980be0cf0c6cbc606019e98e (diff)
downloadhqemu-7fc505e1d659c75faf568441b8827416c1cb65dd.zip
hqemu-7fc505e1d659c75faf568441b8827416c1cb65dd.tar.gz
osdep: fix socket_error() to work with Mingw64
Historically QEMU has had a socket_error() macro that was defined to map to WSASocketError(). The os-win32.h header file would define errno constants that mapped to the WSA error constants. This worked fine with Mingw32 since its header files never defined any errno values, nor did it even provide an errno.h. So callers of socket_error() could match on traditional Exxxx constants and it would all "just work". With Mingw64 though, things work rather differently. First there is an errno.h file which defines all the traditional errno constants you'd expect from a UNIX platform. There is then a winerror.h which defined the WSA error constants. Crucially the WSAExxxx errno values in winerror.h do not match the Exxxx errno values in error.h. If QEMU had only imported winerror.h it would still work, but the qemu/osdep.h file unconditionally imports errno.h. So callers of socket_error() will get now WSAExxxx values back and compare them to the Exxx constants. This will always fail silently at runtime. To solve this QEMU needs to stop assuming the WSAExxxx constant values match the Exxx constant values. Thus the socket_error() macro is turned into a small function that re-maps WSAExxxx values into Exxx. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'device_tree.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud