Merge branch 'wip/pwithnall/gsocket-eaddrnotavail-macos' into 'main'

gioerror: Map EADDRNOTAVAIL to G_IO_ERROR_CONNECTION_REFUSED

Closes #3394

See merge request GNOME/glib!4111
This commit is contained in:
Philip Withnall 2024-06-13 19:57:24 +00:00
commit 9e680ff8f4
2 changed files with 7 additions and 1 deletions

View File

@ -208,6 +208,12 @@ g_io_error_from_errno (gint err_no)
break;
#endif
#ifdef EADDRNOTAVAIL
case EADDRNOTAVAIL:
return G_IO_ERROR_CONNECTION_REFUSED;
break;
#endif
#ifdef ECONNRESET
case ECONNRESET:
return G_IO_ERROR_CONNECTION_CLOSED;

View File

@ -572,7 +572,7 @@ test_error_from_errno (void)
#ifdef EADDRNOTAVAIL
g_assert_cmpuint (g_io_error_from_errno (EADDRNOTAVAIL), ==,
G_IO_ERROR_FAILED);
G_IO_ERROR_CONNECTION_REFUSED);
#endif
#ifdef ENETDOWN