Skip to content
  • Philip Withnall's avatar
    gioerror: Map EADDRNOTAVAIL to G_IO_ERROR_CONNECTION_REFUSED · a2000e2b
    Philip Withnall authored
    Previously it was mapped (as a default) to `G_IO_ERROR_FAILED`.
    
    It’s the error that macOS returns when trying to connect to a socket which
    is bound but not listened to. Linux returns `ECONNREFUSED` in this case.
    It’s helpful if they both map to the same `GIOError` value.
    
    This should fix the `/socket-client/connection-fail` test on macOS,
    which is currently
    [failing](https://gitlab.gnome.org/GNOME/glib/-/jobs/3970547
    
    ) with:
    ```
     # GLib-GIO-DEBUG: GSocketClient: Starting TCP connection attempt
     # GLib-GIO-DEBUG: GSocketClient: Connection attempt failed: Can't assign requested address
     # GLib-GIO-DEBUG: GSocketClient: Starting new address enumeration
     # GLib-GIO-DEBUG: GSocketClient: Address enumeration completed (out of addresses)
     # GLib-GIO-DEBUG: GSocketClient: Address enumeration failed: (null)
     # GLib-GIO-DEBUG: GSocketClient: Connection failed: Could not connect to localhost: Can't assign requested address
    not ok /socket-client/connection-fail - GLib-GIO:ERROR:../gio/tests/gsocketclient-slow.c:231:test_connection_failed: assertion failed (local_error == (g-io-error-quark, 39)): Could not connect to localhost: Can't assign requested address (g-io-error-quark, 0)
    Bail out!
    ```
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    See: #3184
    Fixes: #3394
    a2000e2b