Commit Graph

9 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
b64fd312da gerror: Add an utility function to get the GIO Error from GFileError
When GIO functions are using GLib file utils functions we expect to
return a GIO Error, so provide a way to map such error values.
2022-06-22 20:07:25 +02:00
Marco Trevisan (Treviño)
e5841beba6 gioerror: Map ENOSYS to G_IO_ERROR_NOT_SUPPORTED
If a wrong syscall is used, we can assume that such feature is not
supported at higher level.
2022-06-15 20:44:10 +02:00
Marco Trevisan (Treviño)
587f5f25d0 gioerror: Map ENETDOWN to G_IO_ERROR_NETWORK_UNREACHABLE 2022-06-15 20:44:10 +02:00
Marco Trevisan (Treviño)
3d6f843097 gioerror: Map ENOMSG, EBADMSG and ENODATA to G_IO_ERROR_INVALID_DATA 2022-06-15 20:44:10 +02:00
Marco Trevisan (Treviño)
19417b1a67 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").
2022-06-15 20:44:10 +02:00
Marco Trevisan (Treviño)
6bc6b7ef30 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.
2022-06-15 20:44:10 +02:00
Marco Trevisan (Treviño)
d2ca48ad97 gioerror: Add G_IO_ERROR_NO_SUCH_DEVICE to map ENODEV 2022-06-15 20:43:56 +02:00
Marco Trevisan (Treviño)
9e09894414 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.
2022-06-15 20:41:53 +02:00
Marco Trevisan (Treviño)
35c6c5c663 tests: Add unit test for GIOErrorEnum conversion functions 2022-06-15 20:41:52 +02:00