rrdcached: Create the base directory on startup. -- Sebastian Harl
[rrdtool.git] / src / rrd_daemon.c
index 7406325..0422389 100644 (file)
@@ -2907,6 +2907,13 @@ static int read_options (int argc, char **argv) /* {{{ */
           return (3);
         }
 
           return (3);
         }
 
+        if (rrd_mkdir_p (config_base_dir, 0777) != 0)
+        {
+          fprintf (stderr, "Failed to create base directory '%s': %s\n",
+              config_base_dir, rrd_strerror (errno));
+          return (3);
+        }
+
         /* make sure that the base directory is not resolved via
          * symbolic links.  this makes some performance-enhancing
          * assumptions possible (we don't have to resolve paths
         /* make sure that the base directory is not resolved via
          * symbolic links.  this makes some performance-enhancing
          * assumptions possible (we don't have to resolve paths