summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8afd4d6)
raw | patch | inline | side by side (parent: 8afd4d6)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 26 Apr 2010 12:38:11 +0000 (12:38 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 26 Apr 2010 12:38:11 +0000 (12:38 +0000) |
trying to read past journals (journal_init function). Added an extra check
to journal_init before reading the directory, and, when parsing the command
line options, to expand the relative path to an absolute path. -- Adrian-Ioan Vasile yoyo@opennet.ro
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2072 a5681a0c-68f1-0310-ab6d-d61299d08faa
to journal_init before reading the directory, and, when parsing the command
line options, to expand the relative path to an absolute path. -- Adrian-Ioan Vasile yoyo@opennet.ro
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2072 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index 3be6e7845487186af62697a67761a2ec0aa5d05f..6fda921be36cb754261ac7b06b88d9e21f8d9fd0 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
}
dir = opendir(journal_dir);
+ if (!dir) {
+ RRDD_LOG(LOG_CRIT, "journal_init: opendir(%s) failed\n", journal_dir);
+ return;
+ }
while ((dent = readdir(dir)) != NULL)
{
/* looks like a journal file? */
case 'j':
{
- const char *dir = journal_dir = strdup(optarg);
+ char journal_dir_actual[PATH_MAX];
+ const char *dir;
+ dir = journal_dir = strdup(realpath((const char *)optarg, journal_dir_actual));
status = rrd_mkdir_p(dir, 0777);
if (status != 0)