gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 02/03: handle errors without crashing


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 02/03: handle errors without crashing
Date: Tue, 21 Feb 2017 20:14:54 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 6ffe3aeeacef611c3c34d18fd6b74763ca013b7c
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Feb 21 20:11:20 2017 +0100

    handle errors without crashing
---
 src/namestore/test_namestore_api_remove.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/namestore/test_namestore_api_remove.c 
b/src/namestore/test_namestore_api_remove.c
index c6c439e86..2d670c1ee 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.c
@@ -98,19 +98,22 @@ remove_cont (void *cls,
             int32_t success,
             const char *emsg)
 {
+  nsqe = NULL;
   if (GNUNET_YES != success)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-             _("Records could not be removed: `%s'\n"), emsg);
-    if (endbadly_task != NULL)
+                _("Records could not be removed: `%s'\n"),
+                emsg);
+    if (NULL != endbadly_task)
       GNUNET_SCHEDULER_cancel (endbadly_task);
-    endbadly_task =  GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+    endbadly_task =  GNUNET_SCHEDULER_add_now (&endbadly,
+                                               NULL);
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              "Records were removed, perform lookup\n");
   removed = GNUNET_YES;
-  if (endbadly_task != NULL)
+  if (NULL != endbadly_task)
     GNUNET_SCHEDULER_cancel (endbadly_task);
   GNUNET_SCHEDULER_add_now (&end, NULL);
 }
@@ -139,8 +142,11 @@ put_cont (void *cls, int32_t success,
              "Name store added record for `%s': %s\n",
              name,
              (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
-  nsqe = GNUNET_NAMESTORE_records_store (nsh, privkey, name,
-                                        0, NULL, &remove_cont, (void *) name);
+  nsqe = GNUNET_NAMESTORE_records_store (nsh,
+                                         privkey,
+                                         name,
+                                        0, NULL,
+                                         &remove_cont, (void *) name);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]