email plugin: Make UNIX socket path configurable at compile time.
authorSebastian Harl <sh@tokkee.org>
Mon, 4 Dec 2006 22:58:44 +0000 (23:58 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 5 Dec 2006 09:18:06 +0000 (10:18 +0100)
The prefix for the UNIX socket can be configured using the
COLLECTD_SOCKET_PREFIX macro. "email" will be prepended to it.

If you configure collectd using

  CFLAGS="-DCOLLECTD_SOCKET_PREFIX='\"$path-\"'" ./configure

the socket will be found at "$path-email".

Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/email.c

index b799597..b5d8acf 100644 (file)
 /* 256 bytes ought to be enough for anybody ;-) */
 #define BUFSIZE 256
 
-#define SOCK_PATH "/tmp/.collectd-email"
+#ifndef COLLECTD_SOCKET_PREFIX
+# define COLLECTD_SOCKET_PREFIX "/tmp/.collectd-"
+#endif /* COLLECTD_SOCKET_PREFIX */
+
+#define SOCK_PATH COLLECTD_SOCKET_PREFIX"email"
 #define MAX_CONNS 5
 #define MAX_CONNS_LIMIT 16384