[glib: 10/24] gioerror: Map ENOSYS to G_IO_ERROR_NOT_SUPPORTED




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

    gioerror: Map ENOSYS to G_IO_ERROR_NOT_SUPPORTED
    
    If a wrong syscall is used, we can assume that such feature is not
    supported at higher level.

 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 0e39992bb0..37c8122dc3 100644
--- a/gio/gioerror.c
+++ b/gio/gioerror.c
@@ -230,6 +230,12 @@ g_io_error_from_errno (gint err_no)
       break;
 #endif
 
+#ifdef ENOSYS
+    case ENOSYS:
+      return G_IO_ERROR_NOT_SUPPORTED;
+      break;
+#endif
+
 #ifdef ETIMEDOUT
     case ETIMEDOUT:
       return G_IO_ERROR_TIMED_OUT;
diff --git a/gio/tests/error.c b/gio/tests/error.c
index 298fa88b0e..a38008eee3 100644
--- a/gio/tests/error.c
+++ b/gio/tests/error.c
@@ -322,7 +322,7 @@ test_error_from_errno (void)
 
 #ifdef ENOSYS
   g_assert_cmpuint (g_io_error_from_errno (ENOSYS), ==,
-                    G_IO_ERROR_FAILED);
+                    G_IO_ERROR_NOT_SUPPORTED);
 #endif
 
 #ifdef ENOMSG


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