From 702549ddc1e561ad3307506616ce16ec19de5cd2 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 9 Jul 2007 05:32:15 +0000 Subject: [PATCH] save errno to prevent it being clobbered by call to 2007-07-09 Ryan Lortie * glib/gfileutils.c (write_to_temp_file): save errno to prevent it being clobbered by call to g_filename_display_name(). Bug #453796. svn path=/trunk/; revision=5608 --- ChangeLog | 5 +++++ glib/gfileutils.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f2718f5..7f99f02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-07-09 Ryan Lortie + + * glib/gfileutils.c (write_to_temp_file): save errno to prevent it + being clobbered by call to g_filename_display_name(). Bug #453796. + 2007-07-09 Matthias Clasen * m4macros/glib-gettext.m4: Fix a small problem with diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 7c271bb..040ed7b 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -920,11 +920,12 @@ write_to_temp_file (const gchar *contents, errno = 0; fd = create_temp_file (tmp_name, 0666); + save_errno = errno; + display_name = g_filename_display_name (tmp_name); if (fd == -1) { - save_errno = errno; g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (save_errno), -- 2.7.4