summaryrefslogtreecommitdiff
path: root/gio/gfileenumerator.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-06-11 13:44:19 -0400
committerDan Winship <danw@gnome.org>2012-07-10 10:47:55 -0400
commit538b2f106de78b7dfeac2a98f3d5594ed0ed2ade (patch)
treeecc78112d2d59966c3a47c86028396fe0e3d521d /gio/gfileenumerator.c
parenta98d26c9bbd40b5d00d5a1536402c9196534087c (diff)
gio: handle GSimpleAsyncResult errors in _finish vmethods
Originally, the standard idiom with GSimpleAsyncResult was to handle all errors in the _finish wrapper function, so that vmethods only had to deal with successful results. But this means that chaining up to a parent _finish vmethod won't work correctly. Fix this by also checking for errors in all the relevant vmethods. (We have to redundantly check in both the vmethod and the wrapper to preserve compatibility.) https://bugzilla.gnome.org/show_bug.cgi?id=667375 https://bugzilla.gnome.org/show_bug.cgi?id=661767
Diffstat (limited to 'gio/gfileenumerator.c')
-rw-r--r--gio/gfileenumerator.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c
index 654c69113..fa6863d41 100644
--- a/gio/gfileenumerator.c
+++ b/gio/gfileenumerator.c
@@ -693,6 +693,9 @@ g_file_enumerator_real_next_files_finish (GFileEnumerator *enumer
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_next_files_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
res = op->files;
@@ -750,7 +753,12 @@ g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_close_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
return TRUE;
}