[gnome-autoar] Prevent using g_return_val_if_fail to check error



commit 1aafa63a8e84566bd5911fee1d445f36bbc36466
Author: Ting-Wei Lan <lantw44 gmail com>
Date:   Fri Sep 6 18:32:04 2013 +0800

    Prevent using g_return_val_if_fail to check error

 gnome-autoar/autoar-create.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnome-autoar/autoar-create.c b/gnome-autoar/autoar-create.c
index 3c178bd..30cf04a 100644
--- a/gnome-autoar/autoar-create.c
+++ b/gnome-autoar/autoar-create.c
@@ -424,7 +424,10 @@ libarchive_write_open_cb (struct archive *ar_write,
                                                            G_FILE_CREATE_NONE,
                                                            arcreate->priv->cancellable,
                                                            &(arcreate->priv->error));
-  g_return_val_if_fail (arcreate->priv->error == NULL, ARCHIVE_FATAL);
+  if (arcreate->priv->error != NULL) {
+    g_debug ("libarchive_write_open_cb: ARCHIVE_FATAL");
+    return ARCHIVE_FATAL;
+  }
 
   g_debug ("libarchive_write_open_cb: ARCHIVE_OK");
   return ARCHIVE_OK;
@@ -479,7 +482,8 @@ libarchive_write_write_cb (struct archive *ar_write,
                                       length,
                                       arcreate->priv->cancellable,
                                       &(arcreate->priv->error));
-  g_return_val_if_fail (arcreate->priv->error == NULL, -1);
+  if (arcreate->priv->error != NULL)
+    return -1;
 
   g_debug ("libarchive_write_write_cb: %lu", write_size);
   return write_size;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]