diff --git a/src/users.c b/src/users.c
index 2739c2beec307bb17f9e55460f0f5ada5ae58b74..5fe1b7114fdd54af590316bd549b0223d885a9ba 100644 (file)
--- a/src/users.c
+++ b/src/users.c
* Sebastian Harl <sh at tokkee.org>
**/
+#include "collectd.h"
#include "common.h"
#include "plugin.h"
-#include "users.h"
#if HAVE_UTMPX_H
# include <utmpx.h>
#define MODULE_NAME "users"
+#if HAVE_GETUTXENT || HAVE_GETUTENT
+# define USERS_HAVE_READ 1
+#else
+# define USERS_HAVE_READ 0
+#endif
+
static char *rrd_file = "users.rrd";
static char *ds_def[] =
{
return;
} /* static void users_write(char *host, char *inst, char *val) */
+#if USERS_HAVE_READ
/* I don't like this temporary macro definition - well it's used everywhere
else in the collectd-sources, so I will just stick with it... */
#define BUFSIZE 256
return;
} /* static void users_read(void) */
+#else
+# define users_read NULL
+#endif /* USERS_HAVE_READ */
void module_register (void)
{