gioerror: Add conversion from ENXIO to G_IO_ERROR_NOT_REGULAR_FILE

`ENXIO` can be returned from `open(2)` for special files (FIFOs, device
files and domain sockets) which are not backed by anything.

This fixes the error returned by `g_file_replace()` when trying to
replace such a file, so that it now matches the documentation.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall
2021-02-26 13:25:50 +00:00
parent 730015a8ed
commit 57a53ec964
2 changed files with 10 additions and 4 deletions

View File

@@ -107,6 +107,12 @@ g_io_error_from_errno (gint err_no)
break;
#endif
#ifdef ENXIO
case ENXIO:
return G_IO_ERROR_NOT_REGULAR_FILE;
break;
#endif
#ifdef EROFS
case EROFS:
return G_IO_ERROR_READ_ONLY;