gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6807 - in GNUnet/src/util: config disk os threads


From: gnunet
Subject: [GNUnet-SVN] r6807 - in GNUnet/src/util: config disk os threads
Date: Mon, 12 May 2008 14:30:53 -0600 (MDT)

Author: grothoff
Date: 2008-05-12 14:30:45 -0600 (Mon, 12 May 2008)
New Revision: 6807

Modified:
   GNUnet/src/util/config/configtest.c
   GNUnet/src/util/disk/storagetest.c
   GNUnet/src/util/os/semaphoretest.c
   GNUnet/src/util/threads/semaphoretest.c
Log:
cleanup

Modified: GNUnet/src/util/config/configtest.c
===================================================================
--- GNUnet/src/util/config/configtest.c 2008-05-12 19:18:18 UTC (rev 6806)
+++ GNUnet/src/util/config/configtest.c 2008-05-12 20:30:45 UTC (rev 6807)
@@ -40,7 +40,10 @@
       GNUNET_GC_get_configuration_value_string (cfg, "test", "b", NULL, &c))
     return 1;
   if (0 != strcmp ("b", c))
-    return 1;
+    {
+      GNUNET_free (c);
+      return 1;
+    }
   GNUNET_free (c);
   if (0 != GNUNET_GC_get_configuration_value_number (cfg,
                                                      "test", "five", 0, 10, 9,

Modified: GNUnet/src/util/disk/storagetest.c
===================================================================
--- GNUnet/src/util/disk/storagetest.c  2008-05-12 19:18:18 UTC (rev 6806)
+++ GNUnet/src/util/disk/storagetest.c  2008-05-12 20:30:45 UTC (rev 6807)
@@ -32,11 +32,20 @@
 static int
 testReadWrite ()
 {
-  char tmp[100];
+  char tmp[100+1];
+  int ret;
 
   GNUNET_disk_file_write (NULL, ".testfile", TESTSTRING, strlen (TESTSTRING),
                           "644");
-  tmp[GNUNET_disk_file_read (NULL, ".testfile", 100, tmp)] = '\0';
+  ret = GNUNET_disk_file_read (NULL, ".testfile", 100, tmp);
+  if (ret < 0)
+    { 
+      fprintf (stderr,
+               "Error reading file `%s' in testReadWrite\n",
+               ".testfile"); 
+      return 1;
+    }
+  tmp[ret] = '\0';
   if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
     {
       fprintf (stderr,

Modified: GNUnet/src/util/os/semaphoretest.c
===================================================================
--- GNUnet/src/util/os/semaphoretest.c  2008-05-12 19:18:18 UTC (rev 6806)
+++ GNUnet/src/util/os/semaphoretest.c  2008-05-12 20:30:45 UTC (rev 6807)
@@ -108,7 +108,8 @@
                   printf ("Could not write to testfile: %s\n",
                           STRERROR (errno));
                   ret = 1;
-                  goto END;
+                 fclose (fd);
+                 goto END;
                 }
               fclose (fd);
               GNUNET_IPC_semaphore_up (ipc);

Modified: GNUnet/src/util/threads/semaphoretest.c
===================================================================
--- GNUnet/src/util/threads/semaphoretest.c     2008-05-12 19:18:18 UTC (rev 
6806)
+++ GNUnet/src/util/threads/semaphoretest.c     2008-05-12 20:30:45 UTC (rev 
6807)
@@ -105,6 +105,7 @@
       while (tv != 2)
         GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);    /* busy 
waiting may not always work */
       GNUNET_mutex_destroy (lock);
+      GNUNET_thread_join (pt, &unused);
       printf ("MUTEX test failed at %s:%u\n", __FILE__, __LINE__);
       return 1;                 /* error */
     }





reply via email to

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