summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47055c4)
raw | patch | inline | side by side (parent: 47055c4)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 12 Mar 2012 10:47:21 +0000 (10:47 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 12 Mar 2012 10:47:21 +0000 (10:47 +0000) |
program/src/rrd_daemon.c | patch | blob | history |
index 4dfe35c283dc0189459417f66b2dc8bd5f37a4c9..f5ab6bbb6599bae1a564a2efb9842c1285a8d9b0 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
{
char journal_dir_actual[PATH_MAX];
const char *dir;
- dir = journal_dir = strdup(realpath((const char *)optarg, journal_dir_actual));
+ if (realpath((const char *)optarg, journal_dir_actual) == NULL)
+ {
+ fprintf(stderr, "Failed to canonicalize the journal directory '%s': %s\n",
+ optarg, rrd_strerror(errno));
+ return 7;
+ }
+ dir = journal_dir = strdup(journal_dir_actual);
+ if (dir == NULL) {
+ fprintf (stderr, "read_options: strdup failed.\n");
+ return (3);
+ }
status = rrd_mkdir_p(dir, 0777);
if (status != 0)