-rps test: try to close file in case of failure
authorJulius Bünger <buenger@mytum.de>
Wed, 14 Sep 2016 21:43:52 +0000 (21:43 +0000)
committerJulius Bünger <buenger@mytum.de>
Wed, 14 Sep 2016 21:43:52 +0000 (21:43 +0000)
src/rps/test_rps.c

index 629b73d443f148710aa42850a33325674cbe8165..4b4dfc8bab1d582cccf965f72bf8abb6c3f891ee 100644 (file)
@@ -399,12 +399,19 @@ tofile_ (const char *file_name, const char *line)
                 "Unable to write to file! (Size: %lu, size2: %lu)\n",
                 size,
                 size2);
+    if (GNUNET_YES != GNUNET_DISK_file_close (f))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "Unable to close file\n");
+    }
     return;
   }
 
   if (GNUNET_YES != GNUNET_DISK_file_close (f))
+  {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Unable to close file\n");
+  }
 }
 
 /**