[glib: 6/24] gioerror: Map ETXTBSY to G_FILE_ERROR_BUSY
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 6/24] gioerror: Map ETXTBSY to G_FILE_ERROR_BUSY
- Date: Thu, 23 Jun 2022 11:49:59 +0000 (UTC)
commit 6bc6b7ef3012487966a99a5db06d27000205ab38
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Tue Jun 14 18:41:33 2022 +0200
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.
gio/gioerror.c | 6 ++++++
gio/tests/error.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gio/gioerror.c b/gio/gioerror.c
index a879f2edfc..80ce71f90b 100644
--- a/gio/gioerror.c
+++ b/gio/gioerror.c
@@ -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;
diff --git a/gio/tests/error.c b/gio/tests/error.c
index 8f28a387e1..8cb9e71976 100644
--- a/gio/tests/error.c
+++ b/gio/tests/error.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]