From 587f5f25d0e97a454a3ff0f7549ebf9a67f28b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 14 Jun 2022 19:14:35 +0200 Subject: [PATCH] gioerror: Map ENETDOWN to G_IO_ERROR_NETWORK_UNREACHABLE --- gio/gioerror.c | 6 ++++++ gio/tests/error.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gio/gioerror.c b/gio/gioerror.c index a23664986..0e39992bb 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -291,6 +291,12 @@ g_io_error_from_errno (gint err_no) break; #endif +#ifdef ENETDOWN + case ENETDOWN: + return G_IO_ERROR_NETWORK_UNREACHABLE; + break; +#endif + #ifdef ECONNREFUSED case ECONNREFUSED: return G_IO_ERROR_CONNECTION_REFUSED; diff --git a/gio/tests/error.c b/gio/tests/error.c index 2f5189b99..298fa88b0 100644 --- a/gio/tests/error.c +++ b/gio/tests/error.c @@ -577,7 +577,7 @@ test_error_from_errno (void) #ifdef ENETDOWN g_assert_cmpuint (g_io_error_from_errno (ENETDOWN), ==, - G_IO_ERROR_FAILED); + G_IO_ERROR_NETWORK_UNREACHABLE); #endif #ifdef ECONNABORTED