do create directory if it doesn't exist
authorChristian Grothoff <christian@grothoff.org>
Sat, 11 Apr 2020 19:55:51 +0000 (21:55 +0200)
committerChristian Grothoff <christian@grothoff.org>
Sat, 11 Apr 2020 19:55:51 +0000 (21:55 +0200)
src/util/crypto_ecc_setup.c

index 5167a33fb102af55fe11a04f2db0e2731e86acc6..6c71030b2462acc1e9f857f10502cecbac7ac177 100644 (file)
@@ -143,6 +143,14 @@ atomic_write_to_file (const char *filename,
   char *tmpl;
   int fd;
 
+  if (GNUNET_OK !=
+      GNUNET_DISK_directory_create_for_file (filename))
+  {
+    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+                              "mkstemp",
+                              filename);
+    return GNUNET_SYSERR;
+  }
   {
     char *dname;