diff --git a/src/serial.c b/src/serial.c
index 20a51e70d91b549e3bb6898af689d43c0910dca9..0c6050d72c9a9e7533782ba2dd458627268532e0 100644 (file)
--- a/src/serial.c
+++ b/src/serial.c
/**
* collectd - src/serial.c
/**
* collectd - src/serial.c
- * Copyright (C) 2005 David Bacher
+ * Copyright (C) 2005,2006 David Bacher
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
static char *ds_def[] =
{
static char *ds_def[] =
{
- "DS:incoming:COUNTER:25:0:U",
- "DS:outgoing:COUNTER:25:0:U",
+ "DS:incoming:COUNTER:"COLLECTD_HEARTBEAT":0:U",
+ "DS:outgoing:COUNTER:"COLLECTD_HEARTBEAT":0:U",
NULL
};
static int ds_num = 2;
NULL
};
static int ds_num = 2;
rrd_update_file (host, file, val, ds_def, ds_num);
}
rrd_update_file (host, file, val, ds_def, ds_num);
}
+#if SERIAL_HAVE_READ
#define BUFSIZE 512
static void serial_submit (char *device,
unsigned long long incoming,
#define BUFSIZE 512
static void serial_submit (char *device,
unsigned long long incoming,
}
#undef BUFSIZE
}
#undef BUFSIZE
-#if SERIAL_HAVE_READ
static void serial_read (void)
{
#ifdef KERNEL_LINUX
static void serial_read (void)
{
#ifdef KERNEL_LINUX
fclose (fh);
#endif /* KERNEL_LINUX */
}
fclose (fh);
#endif /* KERNEL_LINUX */
}
+#else
+# define serial_read NULL
#endif /* SERIAL_HAVE_READ */
void module_register (void)
{
#endif /* SERIAL_HAVE_READ */
void module_register (void)
{
- plugin_register (MODULE_NAME, serial_init,
-#if SERIAL_HAVE_READ
- serial_read,
-#else
- NULL,
-#endif
- serial_write);
+ plugin_register (MODULE_NAME, serial_init, serial_read, serial_write);
}
#undef MODULE_NAME
}
#undef MODULE_NAME