summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5f5ac9)
raw | patch | inline | side by side (parent: f5f5ac9)
author | octo <octo> | |
Fri, 14 Apr 2006 07:15:17 +0000 (07:15 +0000) | ||
committer | octo <octo> | |
Fri, 14 Apr 2006 07:15:17 +0000 (07:15 +0000) |
src/collectd.c | patch | blob | history | |
src/common.c | patch | blob | history | |
src/common.h | patch | blob | history | |
src/configfile.c | patch | blob | history |
diff --git a/src/collectd.c b/src/collectd.c
index 369c266439d2f3474ce70b275062db95ed2d2fa5..7b264e832efd18c6fb2e9aaf41f27146bb1349b8 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
* exported variables
*/
time_t curtime;
-
-int operating_mode;
+int operating_mode;
static void sigIntHandler (int signal)
{
diff --git a/src/common.c b/src/common.c
index 3018fa49b04fb69cc6c65e3720492f1481fdc2f8..0b603fa876dcd9b823584fa355bd66087ab5a94b 100644 (file)
--- a/src/common.c
+++ b/src/common.c
return (0);
}
-int check_create_dir (const char *file_orig)
+static int check_create_dir (const char *file_orig)
{
struct stat statbuf;
return (0);
}
-int log_create_file (char *filename, char **ds_def, int ds_num)
+static int log_create_file (char *filename, char **ds_def, int ds_num)
{
FILE *log;
int i;
return 0;
}
-int log_update_file (char *host, char *file, char *values,
+static int log_update_file (char *host, char *file, char *values,
char **ds_def, int ds_num)
{
char *tmp;
return (0);
} /* int log_update_file */
-int rrd_create_file (char *filename, char **ds_def, int ds_num)
+#if HAVE_LIBRRD
+static int rrd_create_file (char *filename, char **ds_def, int ds_num)
{
-#ifdef HAVE_LIBRRD
char **argv;
int argc;
int i, j;
free (argv);
return (status);
-#else
- return (1);
-#endif /* HAVE_LIBRRD */
}
+#endif /* HAVE_LIBRRD */
int rrd_update_file (char *host, char *file, char *values,
char **ds_def, int ds_num)
{
+#if HAVE_LIBRRD
struct stat statbuf;
char full_file[1024];
char *argv[4] = { "update", full_file, values, NULL };
+#endif /* HAVE_LIBRRD */
/* I'd rather have a function `common_update_file' to make this
* decission, but for that we'd need to touch all plugins.. */
return (log_update_file (host, file, values,
ds_def, ds_num));
+#if HAVE_LIBRRD
/* host == NULL => local mode */
if (host != NULL)
{
return (-1);
}
-#ifdef HAVE_LIBRRD
optind = 0; /* bug in librrd? */
rrd_clear_error ();
if (rrd_update (3, argv) == -1)
syslog (LOG_WARNING, "rrd_update failed: %s: %s", full_file, rrd_get_error ());
return (-1);
}
-#endif /* HAVE_LIBRRD */
return (0);
+/* #endif HAVE_LIBRRD */
+
+#else
+ syslog (LOG_ERR, "`rrd_update_file' was called, but collectd isn't linked against librrd!");
+ return (-1);
+#endif
}
#ifdef HAVE_LIBKSTAT
diff --git a/src/common.h b/src/common.h
index 59984b182a0e1ac1e2ef3837fefec7e6bfddd1ab..ae93635f1ab3917618d31fcda174951118af9049 100644 (file)
--- a/src/common.h
+++ b/src/common.h
*/
int escape_slashes (char *buf, int buf_len);
-int rrd_update_file (char *host, char *file, char *values, char **ds_def,
- int ds_num);
+int rrd_update_file (char *host, char *file, char *values,
+ char **ds_def, int ds_num);
#ifdef HAVE_LIBKSTAT
int get_kstat (kstat_t **ksp_ptr, char *module, int instance, char *name);
diff --git a/src/configfile.c b/src/configfile.c
index 70ee6d601911109905ffb59e0e7d0167320bcbb6..45fe6845afa9c50ddeb856387d4a503b46a2e07c 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (strcasecmp (value, "Client") == 0)
operating_mode = MODE_CLIENT;
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
plugin_set_dir (value);
cf_mode_item_t *item;
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (extra == NULL)
{
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (plugin_load (value))
syslog (LOG_ERR, "plugin_load (%s): failed to load plugin", value);
char *service = NET_DEFAULT_PORT;
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
buffer = strdup (value);
if (buffer == NULL)
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (flags == LC_FLAGS_SECTIONSTART)
{
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if ((nesting_depth == 0) || (current_module == NULL))
{