projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
daemon: fix build warning
[collectd.git]
/
src
/
daemon
/
collectd.c
diff --git
a/src/daemon/collectd.c
b/src/daemon/collectd.c
index
517eec7
..
e63c846
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-43,6
+43,10
@@
#include <statgrab.h>
#endif
#include <statgrab.h>
#endif
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#ifndef COLLECTD_LOCALE
#define COLLECTD_LOCALE "C"
#endif
#ifndef COLLECTD_LOCALE
#define COLLECTD_LOCALE "C"
#endif
@@
-201,6
+205,7
@@
static int change_basedir(const char *orig_dir, _Bool create) {
} /* static int change_basedir (char *dir) */
#if HAVE_LIBKSTAT
} /* static int change_basedir (char *dir) */
#if HAVE_LIBKSTAT
+extern kstat_ctl_t *kc;
static void update_kstat(void) {
if (kc == NULL) {
if ((kc = kstat_open()) == NULL)
static void update_kstat(void) {
if (kc == NULL) {
if ((kc = kstat_open()) == NULL)
@@
-367,7
+372,7
@@
static int notify_upstart(void) {
return 0;
}
return 0;
}
- NOTICE("Upstart detected, stopping now to signal read
y
ness.");
+ NOTICE("Upstart detected, stopping now to signal read
i
ness.");
raise(SIGSTOP);
unsetenv("UPSTART_JOB");
raise(SIGSTOP);
unsetenv("UPSTART_JOB");
@@
-392,7
+397,7
@@
static int notify_systemd(void) {
notifysocket);
return 0;
}
notifysocket);
return 0;
}
- NOTICE("Systemd detected, trying to signal read
y
ness.");
+ NOTICE("Systemd detected, trying to signal read
i
ness.");
unsetenv("NOTIFY_SOCKET");
unsetenv("NOTIFY_SOCKET");
@@
-444,7
+449,7
@@
struct cmdline_config {
_Bool daemonize;
};
_Bool daemonize;
};
-void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
+
static
void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
/* read options */
while (1) {
int c;
/* read options */
while (1) {
int c;
@@
-491,7
+496,7
@@
void read_cmdline(int argc, char **argv, struct cmdline_config *config) {
} /* while (1) */
}
} /* while (1) */
}
-int configure_collectd(struct cmdline_config *config) {
+
static
int configure_collectd(struct cmdline_config *config) {
const char *basedir;
/*
* Read options from the config file, the environment and the command
const char *basedir;
/*
* Read options from the config file, the environment and the command
@@
-550,8
+555,7
@@
int main(int argc, char **argv) {
plugin_init_ctx();
plugin_init_ctx();
- int status;
- if ((status = configure_collectd(&config)) != 0)
+ if (configure_collectd(&config) != 0)
exit(EXIT_FAILURE);
#if COLLECT_DAEMON
exit(EXIT_FAILURE);
#if COLLECT_DAEMON