Save errno before calling other funcs that potentially alter it. Bug

* gio/gdesktopappinfo.c: (ensure_dir):
	* gio/glocalfile.c: (g_local_file_query_filesystem_info),
	(g_local_file_read), (g_local_file_delete), (g_local_file_trash),
	(g_local_file_move):
	* gio/glocalfileinfo.c: (set_xattr), (_g_local_file_info_get),
	(_g_local_file_info_get_from_fd), (set_unix_mode),
	(set_unix_uid_gid), (set_symlink), (set_mtime_atime):
	* gio/glocalfileinputstream.c: (g_local_file_input_stream_read),
	(g_local_file_input_stream_skip),
	(g_local_file_input_stream_close),
	(g_local_file_input_stream_seek):
	* gio/glocalfileoutputstream.c:
	(g_local_file_output_stream_write),
	(g_local_file_output_stream_close),
	(g_local_file_output_stream_seek),
	(g_local_file_output_stream_truncate), (copy_file_data),
	(handle_overwrite_open):
	* gio/gunixinputstream.c: (g_unix_input_stream_read),
	(g_unix_input_stream_close), (read_async_cb), (close_async_cb):
	* gio/gunixoutputstream.c: (g_unix_output_stream_write),
	(g_unix_output_stream_close), (write_async_cb), (close_async_cb):
	Save
	errno before calling other funcs that potentially alter it. Bug
	#514766.

svn path=/trunk/; revision=6466
This commit is contained in:
Christian Persch
2008-02-06 15:10:08 +00:00
parent d87c1c0af4
commit 37ac644bd1
8 changed files with 232 additions and 112 deletions

View File

@@ -1096,7 +1096,7 @@ ensure_dir (DirType type,
GError **error)
{
char *path, *display_name;
int err;
int errsv;
if (type == APP_DIR)
path = g_build_filename (g_get_user_data_dir (), "applications", NULL);
@@ -1107,16 +1107,16 @@ ensure_dir (DirType type,
if (g_mkdir_with_parents (path, 0700) == 0)
return path;
err = errno;
errsv = errno;
display_name = g_filename_display_name (path);
if (type == APP_DIR)
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
_("Can't create user application configuration folder %s: %s"),
display_name, g_strerror (err));
display_name, g_strerror (errsv));
else
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
_("Can't create user MIME configuration folder %s: %s"),
display_name, g_strerror (err));
display_name, g_strerror (errsv));
g_free (display_name);
g_free (path);