Improve error on win32input/output streams

This commit is contained in:
Ignacio Casal Quinteiro 2016-02-25 17:23:50 +01:00
parent 99b30f389e
commit bc5b7332b7
2 changed files with 12 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}