gioerror: Map ENFILE to G_IO_ERROR_TOO_MANY_OPEN_FILES

ENFILE stands for "Too many open files in system", so we can definitely
group it together with EMFILE ("Too many open files").
This commit is contained in:
Marco Trevisan (Treviño) 2022-06-14 18:42:48 +02:00
parent 6bc6b7ef30
commit 19417b1a67
2 changed files with 7 additions and 1 deletions

View File

@ -249,6 +249,12 @@ g_io_error_from_errno (gint err_no)
break;
#endif
#ifdef ENFILE
case ENFILE:
return G_IO_ERROR_TOO_MANY_OPEN_FILES;
break;
#endif
#ifdef EADDRINUSE
case EADDRINUSE:
return G_IO_ERROR_ADDRESS_IN_USE;

View File

@ -277,7 +277,7 @@ test_error_from_errno (void)
#ifdef ENFILE
g_assert_cmpint (g_io_error_from_errno (ENFILE), ==,
G_IO_ERROR_FAILED);
G_IO_ERROR_TOO_MANY_OPEN_FILES);
#endif
#ifdef ENOTTY