projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved the 'librrd' manpage to section 3 -- Sebastian Harl
[rrdtool.git]
/
src
/
rrd_daemon.c
diff --git
a/src/rrd_daemon.c
b/src/rrd_daemon.c
index
b4bc1ee
..
710fa01
100644
(file)
--- a/
src/rrd_daemon.c
+++ b/
src/rrd_daemon.c
@@
-77,11
+77,13
@@
#include <stdlib.h>
#ifndef WIN32
#include <stdlib.h>
#ifndef WIN32
-#include <stdint.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
#include <unistd.h>
#include <strings.h>
#include <inttypes.h>
#include <unistd.h>
#include <strings.h>
#include <inttypes.h>
-#
include <sys/socket.h>
+#include <sys/socket.h>
#else
#else
@@
-2675,7
+2677,6
@@
static int cleanup (void) /* {{{ */
free(queue_threads);
free(config_base_dir);
free(queue_threads);
free(config_base_dir);
- free(config_pid_file);
pthread_mutex_lock(&cache_lock);
g_tree_destroy(cache_tree);
pthread_mutex_lock(&cache_lock);
g_tree_destroy(cache_tree);
@@
-2687,6
+2688,7
@@
static int cleanup (void) /* {{{ */
closelog ();
remove_pidfile ();
closelog ();
remove_pidfile ();
+ free(config_pid_file);
return (0);
} /* }}} int cleanup */
return (0);
} /* }}} int cleanup */
@@
-2921,18
+2923,17
@@
static int read_options (int argc, char **argv) /* {{{ */
case 'j':
{
case 'j':
{
- struct stat statbuf;
const char *dir = journal_dir = strdup(optarg);
const char *dir = journal_dir = strdup(optarg);
- status =
stat(dir, &statbuf
);
+ status =
rrd_mkdir_p(dir, 0777
);
if (status != 0)
{
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;
}
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) : "");
{
fprintf(stderr, "Must specify a writable directory with -j! (%s)\n",
errno ? rrd_strerror(errno) : "");