summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b9f59f8)
raw | patch | inline | side by side (parent: b9f59f8)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 28 Sep 2009 16:15:13 +0000 (16:15 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 28 Sep 2009 16:15:13 +0000 (16:15 +0000) |
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index 16b5df59ebf769d8d4884d5a885feb339347558d..308d3b6b1f42bc062469209da91ca5da0adaff02 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
case 'j':
{
- struct stat statbuf;
const char *dir = journal_dir = strdup(optarg);
- status = stat(dir, &statbuf);
+ status = rrd_mkdir_p(dir, 0777);
if (status != 0)
{
- fprintf(stderr, "Cannot stat '%s' : %s\n", dir, rrd_strerror(errno));
+ fprintf(stderr, "Failed to create journal directory '%s': %s\n",
+ dir, rrd_strerror(errno));
return 6;
}
- if (!S_ISDIR(statbuf.st_mode)
- || access(dir, R_OK|W_OK|X_OK) != 0)
+ if (access(dir, R_OK|W_OK|X_OK) != 0)
{
fprintf(stderr, "Must specify a writable directory with -j! (%s)\n",
errno ? rrd_strerror(errno) : "");