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.
This commit is contained in:
Marco Trevisan (Treviño) 2022-06-14 18:26:05 +02:00
parent 35c6c5c663
commit 9e09894414
2 changed files with 11 additions and 0 deletions

View File

@ -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;

View File

@ -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);