[glib/glib-2-20] Preserve errno when using g_set_error with _() and g_strerror()
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glib/glib-2-20] Preserve errno when using g_set_error with _() and g_strerror()
- Date: Fri, 29 May 2009 01:29:54 -0400 (EDT)
commit eb6c59bc48ccec382925ffc3b32e5bfa1e0479b7
Author: Christian Persch <chpe gnome org>
Date: Tue May 27 23:44:35 2008 +0200
Preserve errno when using g_set_error with _() and g_strerror()
---
gio/glocalfileoutputstream.c | 2 +-
glib/gspawn.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
index 7c73da4..354ee32 100644
--- a/gio/glocalfileoutputstream.c
+++ b/gio/glocalfileoutputstream.c
@@ -291,7 +291,7 @@ g_local_file_output_stream_close (GOutputStream *stream,
int errsv = errno;
g_set_error (error, G_IO_ERROR,
- g_io_error_from_errno (errno),
+ g_io_error_from_errno (errsv),
_("Error renaming temporary file: %s"),
g_strerror (errsv));
goto err_out;
diff --git a/glib/gspawn.c b/glib/gspawn.c
index b566331..406ef2b 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -1462,11 +1462,12 @@ make_pipe (gint p[2],
{
if (pipe (p) < 0)
{
+ gint errsv = errno;
g_set_error (error,
G_SPAWN_ERROR,
G_SPAWN_ERROR_FAILED,
_("Failed to create pipe for communicating with child process (%s)"),
- g_strerror (errno));
+ g_strerror (errsv));
return FALSE;
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]