From 425267c01826bcd0dfaf4404e4895da38f1f15fd Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 4 Oct 2009 11:30:24 +0000 Subject: [PATCH] rrdcached: Create the base directory on startup. -- Sebastian Harl git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1924 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_daemon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c index 7406325c..0422389a 100644 --- a/program/src/rrd_daemon.c +++ b/program/src/rrd_daemon.c @@ -2907,6 +2907,13 @@ static int read_options (int argc, char **argv) /* {{{ */ 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 -- 2.30.2