From e5841beba6b5f5d1a6b7e3ab3ee1825c0a94e53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 14 Jun 2022 19:35:24 +0200 Subject: [PATCH] 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 0e39992bb..37c8122dc 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 298fa88b0..a38008eee 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