Fix perf_crypto_rsa.c after various changes
[oweals/gnunet.git] / src / util / common_logging.c
index 101347bfbcde97b1afc5af30c1c718addce54c4f..4d78f48980c4b80506d151fc6c18da2a48a6b780 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2006-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006-2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -25,6 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_crypto_lib.h"
+#include "gnunet_disk_lib.h"
 #include "gnunet_strings_lib.h"
 #include <regex.h>
 
@@ -357,6 +358,15 @@ setup_log_file (const struct tm *tm)
     return GNUNET_OK; /* no change */
   log_rotate (last_fn);
   strcpy (last_fn, fn);
+  if (GNUNET_SYSERR ==
+      GNUNET_DISK_directory_create_for_file (fn))
+  {
+    fprintf (stderr,
+             "Failed to create directory for `%s': %s\n",
+             fn,
+             STRERROR (errno));
+    return GNUNET_SYSERR;
+  }
 #if WINDOWS
   altlog_fd = OPEN (fn, O_APPEND |
                         O_BINARY |