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.
This commit is contained in:
Руслан Ижбулатов 2019-03-16 15:58:16 +00:00
parent e5ba5845a1
commit 5df0337f52

View File

@ -272,6 +272,12 @@ g_io_error_from_errno (gint err_no)
break; break;
#endif #endif
#ifdef ENOTSOCK
case ENOTSOCK:
return G_IO_ERROR_INVALID_ARGUMENT;
break;
#endif
default: default:
return G_IO_ERROR_FAILED; return G_IO_ERROR_FAILED;
break; break;