gioerror: Map ETXTBSY to G_FILE_ERROR_BUSY

It's a busy text file, but we don't care much about specifics so we
can just return the generic busy error.
This commit is contained in:
Marco Trevisan (Treviño) 2022-06-14 18:41:33 +02:00
parent d2ca48ad97
commit 6bc6b7ef30
2 changed files with 7 additions and 1 deletions

View File

@ -224,6 +224,12 @@ g_io_error_from_errno (gint err_no)
break;
#endif
#ifdef ETXTBSY
case ETXTBSY:
return G_IO_ERROR_BUSY;
break;
#endif
#ifdef EWOULDBLOCK
case EWOULDBLOCK:
return G_IO_ERROR_WOULD_BLOCK;

View File

@ -287,7 +287,7 @@ test_error_from_errno (void)
#ifdef ETXTBSY
g_assert_cmpint (g_io_error_from_errno (ETXTBSY), ==,
G_IO_ERROR_FAILED);
G_IO_ERROR_BUSY);
#endif
#ifdef EFBIG