[glib/wip/win32streams] Improve error on win32input/output streams



commit bc5b7332b7508c4ea58d558f06444b9870a2fdd7
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Feb 25 17:23:50 2016 +0100

    Improve error on win32input/output streams

 gio/gwin32inputstream.c  |    9 ++++++---
 gio/gwin32outputstream.c |    9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gio/gwin32inputstream.c b/gio/gwin32inputstream.c
index ea29b04..bd69730 100644
--- a/gio/gwin32inputstream.c
+++ b/gio/gwin32inputstream.c
@@ -210,9 +210,12 @@ g_win32_input_stream_close (GInputStream  *stream,
     {
       if (close (win32_stream->priv->fd) < 0)
        {
-         g_set_error_literal (error, G_IO_ERROR,
-                              g_io_error_from_errno (errno),
-                              g_strerror (errno));
+         int errsv = errno;
+
+         g_set_error (error, G_IO_ERROR,
+                      g_io_error_from_errno (errsv),
+                      _("Error closing file descriptor: %s"),
+                      g_strerror (errsv));
          return FALSE;
        }
     }
diff --git a/gio/gwin32outputstream.c b/gio/gwin32outputstream.c
index 1e9090c..083746c 100644
--- a/gio/gwin32outputstream.c
+++ b/gio/gwin32outputstream.c
@@ -197,9 +197,12 @@ g_win32_output_stream_close (GOutputStream  *stream,
     {
       if (close (win32_stream->priv->fd) < 0)
        {
-         g_set_error_literal (error, G_IO_ERROR,
-                              g_io_error_from_errno (errno),
-                              g_strerror (errno));
+         int errsv = errno;
+
+         g_set_error (error, G_IO_ERROR,
+                      g_io_error_from_errno (errsv),
+                      _("Error closing file descriptor: %s"),
+                      g_strerror (errsv));
          return FALSE;
        }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]