save errno to prevent it being clobbered by call to

2007-07-09  Ryan Lortie  <desrt@desrt.ca>

        * 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
This commit is contained in:
Ryan Lortie 2007-07-09 05:32:15 +00:00 committed by Ryan Lortie
parent 7a55a55fdc
commit 702549ddc1
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-07-09 Ryan Lortie <desrt@desrt.ca>
* 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 <mclasen@redhat.com>
* m4macros/glib-gettext.m4: Fix a small problem with

View File

@ -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),