gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18856 - in gnunet/src: dv testing util


From: gnunet
Subject: [GNUnet-SVN] r18856 - in gnunet/src: dv testing util
Date: Fri, 30 Dec 2011 23:43:52 +0100

Author: grothoff
Date: 2011-12-30 23:43:52 +0100 (Fri, 30 Dec 2011)
New Revision: 18856

Modified:
   gnunet/src/dv/test_transport_api_dv.c
   gnunet/src/testing/test_testing_large_topology.c
   gnunet/src/testing/test_testing_topology.c
   gnunet/src/testing/test_testing_topology_blacklist.c
   gnunet/src/testing/testing_group.c
   gnunet/src/util/configuration.c
   gnunet/src/util/os_installation.c
   gnunet/src/util/service.c
   gnunet/src/util/test_crypto_hash.c
Log:
-LRN: use FOPEN/CLOSE instead of fopen/close - #2051

Modified: gnunet/src/dv/test_transport_api_dv.c
===================================================================
--- gnunet/src/dv/test_transport_api_dv.c       2011-12-30 22:42:04 UTC (rev 
18855)
+++ gnunet/src/dv/test_transport_api_dv.c       2011-12-30 22:43:52 UTC (rev 
18856)
@@ -274,8 +274,8 @@
 #endif
   if (dotOutFile != NULL)
   {
-    fclose (dotOutFile);
     FPRINTF (dotOutFile, "%s",  "}");
+    FCLOSE (dotOutFile);
   }
 
   ok = 0;
@@ -383,7 +383,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 }
 

Modified: gnunet/src/testing/test_testing_large_topology.c
===================================================================
--- gnunet/src/testing/test_testing_large_topology.c    2011-12-30 22:42:04 UTC 
(rev 18855)
+++ gnunet/src/testing/test_testing_large_topology.c    2011-12-30 22:43:52 UTC 
(rev 18856)
@@ -246,7 +246,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 
   ok = 0;
@@ -303,7 +303,7 @@
     if (outfile != NULL)
     {
       FPRINTF (outfile, "%s",  "}\n");
-      fclose (outfile);
+      FCLOSE (outfile);
       GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
     }
   }
@@ -358,7 +358,7 @@
 #endif
     GNUNET_SCHEDULER_cancel (die_task);
     GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
-    dotOutFileFinished = fopen (dotOutFileNameFinished, "w");
+    dotOutFileFinished = FOPEN (dotOutFileNameFinished, "w");
     GNUNET_free (dotOutFileNameFinished);
     if (dotOutFileFinished != NULL)
     {
@@ -425,7 +425,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 }
 
@@ -949,7 +949,7 @@
 
   ok = 1;
 
-  dotOutFile = fopen (dotOutFileName, "w");
+  dotOutFile = FOPEN (dotOutFileName, "w");
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "strict graph G {\n");

Modified: gnunet/src/testing/test_testing_topology.c
===================================================================
--- gnunet/src/testing/test_testing_topology.c  2011-12-30 22:42:04 UTC (rev 
18855)
+++ gnunet/src/testing/test_testing_topology.c  2011-12-30 22:43:52 UTC (rev 
18856)
@@ -339,7 +339,7 @@
     if (outfile != NULL)
     {
       FPRINTF (outfile, "%s",  "}\n");
-      fclose (outfile);
+      FCLOSE (outfile);
 #if DO_STATS
       GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, NULL);
 #endif
@@ -398,7 +398,7 @@
 #endif
     GNUNET_SCHEDULER_cancel (die_task);
     GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
-    dotOutFileFinished = fopen (dotOutFileNameFinished, "w");
+    dotOutFileFinished = FOPEN (dotOutFileNameFinished, "w");
     GNUNET_free (dotOutFileNameFinished);
     if (dotOutFileFinished != NULL)
     {
@@ -465,7 +465,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 }
 
@@ -1006,7 +1006,7 @@
 
   ok = 1;
 
-  dotOutFile = fopen (dotOutFileName, "w");
+  dotOutFile = FOPEN (dotOutFileName, "w");
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "strict graph G {\n");

Modified: gnunet/src/testing/test_testing_topology_blacklist.c
===================================================================
--- gnunet/src/testing/test_testing_topology_blacklist.c        2011-12-30 
22:42:04 UTC (rev 18855)
+++ gnunet/src/testing/test_testing_topology_blacklist.c        2011-12-30 
22:43:52 UTC (rev 18856)
@@ -143,7 +143,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 
   ok = 0;
@@ -168,7 +168,7 @@
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "}");
-    fclose (dotOutFile);
+    FCLOSE (dotOutFile);
   }
 }
 
@@ -396,7 +396,7 @@
 
   ok = 1;
 
-  dotOutFile = fopen (dotOutFileName, "w");
+  dotOutFile = FOPEN (dotOutFileName, "w");
   if (dotOutFile != NULL)
   {
     FPRINTF (dotOutFile, "%s",  "strict graph G {\n");
@@ -414,7 +414,7 @@
     ok = 404;
     if (dotOutFile != NULL)
     {
-      fclose (dotOutFile);
+      FCLOSE (dotOutFile);
     }
     return;
   }
@@ -453,7 +453,7 @@
       ok = 707;
       if (dotOutFile != NULL)
       {
-        fclose (dotOutFile);
+        FCLOSE (dotOutFile);
       }
       return;
     }
@@ -470,7 +470,7 @@
     ok = 808;
     if (dotOutFile != NULL)
     {
-      fclose (dotOutFile);
+      FCLOSE (dotOutFile);
     }
     return;
   }

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2011-12-30 22:42:04 UTC (rev 18855)
+++ gnunet/src/testing/testing_group.c  2011-12-30 22:43:52 UTC (rev 18856)
@@ -2891,7 +2891,7 @@
   {
     mytemp = GNUNET_DISK_mktemp ("friends");
     GNUNET_assert (mytemp != NULL);
-    temp_friend_handle = fopen (mytemp, "wt");
+    temp_friend_handle = FOPEN (mytemp, "wt");
     GNUNET_assert (temp_friend_handle != NULL);
 #if OLD
     conn_iter = pg->peers[pg_iter].allowed_peers_head;
@@ -2907,7 +2907,7 @@
                                            &friend_file_iterator,
                                            temp_friend_handle);
 #endif
-    fclose (temp_friend_handle);
+    FCLOSE (temp_friend_handle);
 
     if (GNUNET_OK !=
         GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg,
@@ -3064,7 +3064,7 @@
   {
     mytemp = GNUNET_DISK_mktemp ("blacklist");
     GNUNET_assert (mytemp != NULL);
-    temp_file_handle = fopen (mytemp, "wt");
+    temp_file_handle = FOPEN (mytemp, "wt");
     GNUNET_assert (temp_file_handle != NULL);
     temp_transports = GNUNET_strdup (transports);
 #if !OLD
@@ -3106,7 +3106,7 @@
     }
 
     GNUNET_free (temp_transports);
-    fclose (temp_file_handle);
+    FCLOSE (temp_file_handle);
 
     if (GNUNET_OK !=
         GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg,

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2011-12-30 22:42:04 UTC (rev 18855)
+++ gnunet/src/util/configuration.c     2011-12-30 22:43:52 UTC (rev 18856)
@@ -248,7 +248,7 @@
       break;
     }
   }
-  GNUNET_assert (0 == fclose (fp));
+  GNUNET_assert (0 == FCLOSE (fp));
   /* restore dirty flag - anything we set in the meantime
    * came from disk */
   cfg->dirty = dirty;
@@ -348,7 +348,7 @@
   }
   if (error != 0)
     LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fprintf", filename);
-  GNUNET_assert (0 == fclose (fp));
+  GNUNET_assert (0 == FCLOSE (fp));
   if (error != 0)
   {
     cfg->dirty = GNUNET_SYSERR; /* last write failed */

Modified: gnunet/src/util/os_installation.c
===================================================================
--- gnunet/src/util/os_installation.c   2011-12-30 22:42:04 UTC (rev 18855)
+++ gnunet/src/util/os_installation.c   2011-12-30 22:43:52 UTC (rev 18856)
@@ -56,7 +56,7 @@
   char *lgu;
 
   GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/maps", getpid ());
-  f = fopen (fn, "r");
+  f = FOPEN (fn, "r");
   if (f == NULL)
     return NULL;
   while (NULL != fgets (line, sizeof (line), f))
@@ -66,11 +66,11 @@
         (NULL != (lgu = strstr (dir, "libgnunetutil"))))
     {
       lgu[0] = '\0';
-      fclose (f);
+      FCLOSE (f);
       return GNUNET_strdup (dir);
     }
   }
-  fclose (f);
+  FCLOSE (f);
   return NULL;
 }
 

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2011-12-30 22:42:04 UTC (rev 18855)
+++ gnunet/src/util/service.c   2011-12-30 22:43:52 UTC (rev 18856)
@@ -1351,7 +1351,7 @@
   }
   if (0 > FPRINTF (pidfd, "%u", pid))
     LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fprintf", pif);
-  GNUNET_break (0 == fclose (pidfd));
+  GNUNET_break (0 == FCLOSE (pidfd));
   if ((user != NULL) && (0 < strlen (user)))
     GNUNET_DISK_file_change_owner (pif, user);
   GNUNET_free_non_null (user);

Modified: gnunet/src/util/test_crypto_hash.c
===================================================================
--- gnunet/src/util/test_crypto_hash.c  2011-12-30 22:42:04 UTC (rev 18855)
+++ gnunet/src/util/test_crypto_hash.c  2011-12-30 22:43:52 UTC (rev 18856)
@@ -137,9 +137,9 @@
 
   memset (block, 42, sizeof (block) / 2);
   memset (&block[sizeof (block) / 2], 43, sizeof (block) / 2);
-  GNUNET_assert (NULL != (f = fopen (FILENAME, "w+")));
+  GNUNET_assert (NULL != (f = FOPEN (FILENAME, "w+")));
   GNUNET_break (sizeof (block) == fwrite (block, 1, sizeof (block), f));
-  GNUNET_break (0 == fclose (f));
+  GNUNET_break (0 == FCLOSE (f));
   ret = 1;
   GNUNET_SCHEDULER_run (&file_hasher, &ret);
   GNUNET_break (0 == UNLINK (FILENAME));




reply via email to

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