projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8856d7d
)
collectd-flush: Determine default socket from configured localstatedir.
author
Sebastian Harl
<sh@tokkee.org>
Sat, 7 Aug 2010 07:48:16 +0000
(09:48 +0200)
committer
Sebastian Harl
<sh@tokkee.org>
Sat, 7 Aug 2010 07:48:16 +0000
(09:48 +0200)
src/collectd-flush.c
patch
|
blob
|
history
diff --git
a/src/collectd-flush.c
b/src/collectd-flush.c
index
7b9326b
..
3869991
100644
(file)
--- a/
src/collectd-flush.c
+++ b/
src/collectd-flush.c
@@
-19,6
+19,12
@@
* Håkon J Dugstad Johnsen <hakon-dugstad.johnsen at telenor.com>
**/
* Håkon J Dugstad Johnsen <hakon-dugstad.johnsen at telenor.com>
**/
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "libcollectdclient/client.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@
-26,7
+32,7
@@
#include <unistd.h>
#include <getopt.h>
#include <unistd.h>
#include <getopt.h>
-#
include "libcollectdclient/client.h
"
+#
define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock
"
extern char *optarg;
extern char *optarg;
@@
-85,7
+91,7
@@
static void exit_usage (const char *name, int status) {
"Available options:\n"
" -s Path to collectd's UNIX socket.\n"
"Available options:\n"
" -s Path to collectd's UNIX socket.\n"
- " Default:
/var/run/collectd-unixsock
\n"
+ " Default:
"DEFAULT_SOCK"
\n"
" -p <plugin> Plugin to be flushed.\n"
" -i <id> Flush data identified by <id> only (see below).\n"
" -t <seconds> Flush values older than this value only.\n"
" -p <plugin> Plugin to be flushed.\n"
" -i <id> Flush data identified by <id> only (see below).\n"
" -t <seconds> Flush values older than this value only.\n"
@@
-128,7
+134,7
@@
static int charoccurences (const char *str, char chr) {
}
int main (int argc, char **argv) {
}
int main (int argc, char **argv) {
- char address[1024] = "unix:
/var/run/collectd-unixsock"
;
+ char address[1024] = "unix:
"DEFAULT_SOCK
;
char *plugin = NULL;
char ident_str[1024] = "";
int timeout = -1;
char *plugin = NULL;
char ident_str[1024] = "";
int timeout = -1;