[gnome-builder] makecache: add some more assertions
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] makecache: add some more assertions
- Date: Wed, 20 Apr 2016 23:55:33 +0000 (UTC)
commit b51592c6b275adf64a6d9f6e9518bc96cd55bc5c
Author: Christian Hergert <christian hergert me>
Date: Wed Apr 20 16:55:22 2016 -0700
makecache: add some more assertions
Just to be safe we are actually propagating errors.
plugins/autotools/ide-makecache.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 7c1eeb1..7dbb2bb 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -162,12 +162,14 @@ ide_makecache_discover_llvm_flags_worker (GTask *task,
if (!subprocess)
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
if (!g_subprocess_communicate_utf8 (subprocess, NULL, cancellable, &stdoutstr, NULL, &error))
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
@@ -579,6 +581,7 @@ ide_makecache_new_worker (GTask *task,
if (fd == -1)
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
@@ -612,6 +615,7 @@ ide_makecache_new_worker (GTask *task,
if (!subprocess)
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
close (fd);
IDE_EXIT;
@@ -622,6 +626,7 @@ ide_makecache_new_worker (GTask *task,
*/
if (!g_subprocess_wait (subprocess, cancellable, &error))
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
close (fd);
IDE_EXIT;
@@ -653,6 +658,7 @@ ide_makecache_new_worker (GTask *task,
if (!mapped)
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
close (fd);
IDE_EXIT;
@@ -669,6 +675,7 @@ ide_makecache_new_worker (GTask *task,
*/
if (!ide_makecache_validate_mapped_file (mapped, &error))
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
@@ -1038,12 +1045,14 @@ ide_makecache_get_file_flags_worker (GTask *task,
if (!subprocess)
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
if (!g_subprocess_communicate_utf8 (subprocess, NULL, cancellable, &stdoutstr, NULL, &error))
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
@@ -1267,6 +1276,7 @@ ide_makecache_get_file_flags__get_targets_cb (GObject *object,
if (!(targets = ide_makecache_get_file_targets_finish (self, result, &error)))
{
+ g_assert (error != NULL);
g_task_return_error (task, error);
IDE_EXIT;
}
@@ -1552,7 +1562,10 @@ ide_makecache_get_file_targets__task_cache_get_cb (GObject *object,
GPtrArray *ret;
if (!(ret = egg_task_cache_get_finish (cache, result, &error)))
- g_task_return_error (task, error);
+ {
+ g_assert (error != NULL);
+ g_task_return_error (task, error);
+ }
else
g_task_return_pointer (task, ret, (GDestroyNotify)g_ptr_array_unref);
}
@@ -1620,7 +1633,10 @@ ide_makecache_get_file_flags__task_cache_get_cb (GObject *object,
gchar **ret;
if (!(ret = egg_task_cache_get_finish (cache, result, &error)))
- g_task_return_error (task, error);
+ {
+ g_assert (error != NULL);
+ g_task_return_error (task, error);
+ }
else
g_task_return_pointer (task, ret, (GDestroyNotify)g_strfreev);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]