From 5df0337f5291aa0e9574e4930ba5d424c25e24b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Sat, 16 Mar 2019 15:58:16 +0000 Subject: [PATCH] GIO: Convert ENOTSOCK to G_IO_ERROR_INVALID_ARGUMENT instead of using a generic G_IO_ERROR_FAILED error code. This is in line with what W32 part of the code is doing with WSAENOTSOCK. This fix will break two tests in libsoup, which were written following the implementation and thus expect G_IO_ERROR_FAILED when attempting to do stuff with no-longer-valid socket descriptors. --- gio/gioerror.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gio/gioerror.c b/gio/gioerror.c index 900553e98..1ec120d98 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -272,6 +272,12 @@ g_io_error_from_errno (gint err_no) break; #endif +#ifdef ENOTSOCK + case ENOTSOCK: + return G_IO_ERROR_INVALID_ARGUMENT; + break; +#endif + default: return G_IO_ERROR_FAILED; break;