Code

unixsock plugin: Set default path of the UNIX socket to $localstatedir.
authorSebastian Harl <sh@tokkee.org>
Tue, 12 Jun 2007 16:47:53 +0000 (18:47 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 12 Jun 2007 22:01:41 +0000 (00:01 +0200)
For this purpose LOCALSTATEDIR is defined to $localstatedir during
compilation.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/Makefile.am
src/collectd.h
src/unixsock.c

index 1007dbc5a92c6746b28b694b2d9db889ea3edd2e..f7168a99e874eba59c4f965beabb3fedcf4a8d0a 100644 (file)
@@ -25,6 +25,7 @@ collectd_SOURCES = collectd.c collectd.h \
 collectd_CPPFLAGS = $(LTDLINCL)
 collectd_CPPFLAGS += -DPREFIX='"${prefix}"'
 collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
+collectd_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
 collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
 if BUILD_FEATURE_DAEMON
 collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
@@ -527,7 +528,7 @@ endif
 if BUILD_MODULE_UNIXSOCK
 pkglib_LTLIBRARIES += unixsock.la
 unixsock_la_SOURCES = unixsock.c
-unixsock_la_CPPFLAGS = -DPREFIX='"${prefix}"'
+unixsock_la_CPPFLAGS = -DLOCALSTATEDIR='"${localstatedir}"'
 unixsock_la_LDFLAGS = -module -avoid-version -lpthread
 collectd_LDADD += "-dlopen" unixsock.la
 collectd_DEPENDENCIES += unixsock.la
index ac755161d360308b258886ed0352c547226522ff..282e632520ce08cb1a755588c251a10f53aa4e24 100644 (file)
 #define CONFIGFILE SYSCONFDIR"/collectd.conf"
 #endif
 
+#ifndef LOCALSTATEDIR
+#define LOCALSTATEDIR PREFIX "/var"
+#endif
+
 #ifndef PKGLOCALSTATEDIR
 #define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
 #endif
index 215abdd01ec1daeaf8819781bbdd79cac5cc4af9..6302b17f4a279283fc88294091f21d1102e07d7e 100644 (file)
@@ -36,7 +36,7 @@
 # define UNIX_PATH_MAX sizeof (((struct sockaddr_un *)0)->sun_path)
 #endif
 
-#define US_DEFAULT_PATH PREFIX"/var/run/"PACKAGE_NAME"-unixsock"
+#define US_DEFAULT_PATH LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"
 
 /*
  * Private data structures