diff --git a/src/processes.c b/src/processes.c
index d1fe696a9b5558b645646f83b4496e4df831bf9a..3a7318907cd13613578d86ae36cf0e83f59c2afe 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
# define PROCESSES_HAVE_READ 0
#endif
+#define BUFSIZE 256
+
static char *ps_file = "processes.rrd";
static char *ds_def[] =
rrd_update_file (host, ps_file, val, ds_def, ds_num);
}
-#define BUFSIZE 256
+#if PROCESSES_HAVE_READ
static void ps_submit (unsigned int running,
unsigned int sleeping,
unsigned int zombies,
plugin_submit (MODULE_NAME, "-", buf);
}
-#if PROCESSES_HAVE_READ
static void ps_read (void)
{
#ifdef KERNEL_LINUX
char buf[BUFSIZE];
char filename[20]; /* need 17 bytes */
- char *fields[256];
+ char *fields[BUFSIZE];
struct dirent *ent;
DIR *proc;
fclose (fh);
- if (strsplit (buf, fields, 256) < 3)
+ if (strsplit (buf, fields, BUFSIZE) < 3)
continue;
switch (fields[2][0])
#else
# define ps_read NULL
#endif /* PROCESSES_HAVE_READ */
-#undef BUFSIZE
void module_register (void)
{
plugin_register (MODULE_NAME, ps_init, ps_read, ps_write);
}
+#undef BUFSIZE
#undef MODULE_NAME