Create directory for hostkey
authorLRN <lrn1986@gmail.com>
Wed, 24 Oct 2012 08:56:40 +0000 (08:56 +0000)
committerLRN <lrn1986@gmail.com>
Wed, 24 Oct 2012 08:56:40 +0000 (08:56 +0000)
src/transport/test_plugin_transport.c

index 07a20adad82834d24cc3e6ad792ce178a8fbecbb..f0dbc411bbbff63925af1340c45955a94673b54e 100644 (file)
@@ -556,6 +556,15 @@ run (void *cls, char *const *args, const char *cfgfile,
                   HOSTKEY_FILE);
   }
 
+  if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (keyfile))
+  {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  _("Could not create a directory for hostkey `%s'.  Exiting.\n"),
+                  keyfile);
+      end_badly_now ();
+      return;
+  }
+
   if (GNUNET_OK !=  GNUNET_DISK_file_copy (HOSTKEY_FILE, keyfile))
   {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,