[glib: 9/24] gioerror: Map ENETDOWN to G_IO_ERROR_NETWORK_UNREACHABLE




commit 587f5f25d0e97a454a3ff0f7549ebf9a67f28b29
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Jun 14 19:14:35 2022 +0200

    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 a23664986f..0e39992bb0 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 2f5189b99a..298fa88b0e 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]