curly wars / auto-indentation
[oweals/gnunet.git] / src / util / crypto_random.c
index bb105437dfee277645433e02763f4a26ef7f8dda..c74d60f4f8bc7ad2767e7e05d4a8395ed2d99ad0 100644 (file)
 #include "gnunet_os_lib.h"
 #include <gcrypt.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+
 /**
  * Create a cryptographically weak pseudo-random number in the interval of 0 to 1.
- * 
+ *
  * @return number between 0 and 1.
  */
 static double
@@ -209,7 +213,7 @@ entropy_generator (void *cls, const char *what, int printchar, int current,
     if (genproc != NULL)
     {
       if (0 != GNUNET_OS_process_kill (genproc, SIGTERM))
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "kill");
+        LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "kill");
       GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (genproc));
       GNUNET_OS_process_close (genproc);
       genproc = NULL;
@@ -227,13 +231,13 @@ entropy_generator (void *cls, const char *what, int printchar, int current,
       return;
     }
     if (0 != GNUNET_OS_process_kill (genproc, SIGTERM))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "kill");
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "kill");
     GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (genproc));
     GNUNET_OS_process_close (genproc);
     genproc = NULL;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              _("Starting `%s' process to generate entropy\n"), "find");
+  LOG (GNUNET_ERROR_TYPE_INFO, _("Starting `%s' process to generate entropy\n"),
+       "find");
   genproc =
       GNUNET_OS_start_process (NULL, NULL, "sh", "sh", "-c",
                                "exec find / -mount -type f -exec cp {} /dev/null \\; 2>/dev/null",