Code

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 b7995973dae20556392908d52298bafd79c70d88..b5d8acfdf15bb19b1c80b3970a4c765bfb13ca4f 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