From: Ryan Lortie Date: Mon, 9 Jul 2007 05:32:15 +0000 (+0000) Subject: save errno to prevent it being clobbered by call to X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=702549ddc1e561ad3307506616ce16ec19de5cd2;p=dana%2Fcg-glib.git 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 --- diff --git a/ChangeLog b/ChangeLog index f2718f5c..7f99f021 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 7c271bb9..040ed7bc 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),