[glib: 4/24] gioerror: Handle EMLINK error as too-many-links error




commit 9e09894414ca092a07cd094b4fad1fdab0906a98
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Jun 14 18:26:05 2022 +0200

    gioerror: Handle EMLINK error as too-many-links error
    
    This used to be a FreeBSD only error but it's actually defined also in
    linux.

 gio/gioerror.c    | 6 ++++++
 gio/tests/error.c | 5 +++++
 2 files changed, 11 insertions(+)
---
diff --git a/gio/gioerror.c b/gio/gioerror.c
index 52c57d95f1..2df120fc6f 100644
--- a/gio/gioerror.c
+++ b/gio/gioerror.c
@@ -121,6 +121,12 @@ g_io_error_from_errno (gint err_no)
       break;
 #endif
 
+#ifdef EMLINK
+    case EMLINK:
+      return G_IO_ERROR_TOO_MANY_LINKS;
+      break;
+#endif
+
 #ifdef ELOOP
     case ELOOP:
       return G_IO_ERROR_TOO_MANY_LINKS;
diff --git a/gio/tests/error.c b/gio/tests/error.c
index 133c2d7776..8c7fea8eef 100644
--- a/gio/tests/error.c
+++ b/gio/tests/error.c
@@ -85,6 +85,11 @@ test_error_from_errno (void)
                    G_IO_ERROR_TOO_MANY_LINKS);
 #endif
 
+#ifdef EMLINK
+  g_assert_cmpint (g_io_error_from_errno (EMLINK), ==,
+                   G_IO_ERROR_TOO_MANY_LINKS);
+#endif
+
 #ifdef ENOSPC
   g_assert_cmpint (g_io_error_from_errno (ENOSPC), ==,
                    G_IO_ERROR_NO_SPACE);


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