Skip to content
  • Marc-André Lureau's avatar
    d89f30b4
    win32: wrap socket close() with an exception handler · d89f30b4
    Marc-André Lureau authored
    
    
    Since commit abe34282 ("win32: avoid mixing SOCKET and file descriptor
    space"), we set HANDLE_FLAG_PROTECT_FROM_CLOSE on the socket FD, to
    prevent closing the HANDLE with CloseHandle. This raises an exception
    which under gdb is fatal, and qemu exits.
    
    Let's catch the expected error instead.
    
    Note: this appears to work, but the mingw64 macro is not well documented
    or tested, and it's not obvious how it is meant to be used.
    
    Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230515132440.1025315-1-marcandre.lureau@redhat.com>
    d89f30b4
    win32: wrap socket close() with an exception handler
    Marc-André Lureau authored
    
    
    Since commit abe34282 ("win32: avoid mixing SOCKET and file descriptor
    space"), we set HANDLE_FLAG_PROTECT_FROM_CLOSE on the socket FD, to
    prevent closing the HANDLE with CloseHandle. This raises an exception
    which under gdb is fatal, and qemu exits.
    
    Let's catch the expected error instead.
    
    Note: this appears to work, but the mingw64 macro is not well documented
    or tested, and it's not obvious how it is meant to be used.
    
    Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230515132440.1025315-1-marcandre.lureau@redhat.com>
Loading