summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bmon/list.h8
-rw-r--r--src/module.c1
-rw-r--r--src/out_format.c4
3 files changed, 11 insertions, 2 deletions
diff --git a/include/bmon/list.h b/include/bmon/list.h
index c7569d7..fff9409 100644
--- a/include/bmon/list.h
+++ b/include/bmon/list.h
@@ -8,6 +8,14 @@
#ifndef BMON_LIST_H_
#define BMON_LIST_H_
+#ifdef __APPLE__
+/* Apple systems define these macros in system headers, so we undef
+ * them prior to inclusion of this file */
+#undef LIST_HEAD
+#undef LIST_HEAD_INIT
+#undef INIT_LIST_HEAD
+#endif
+
struct list_head
{
struct list_head * next;
diff --git a/src/module.c b/src/module.c
index 5727e58..b245f72 100644
--- a/src/module.c
+++ b/src/module.c
@@ -115,6 +115,7 @@ int module_register(struct bmon_subsys *ss, struct bmon_module *m)
list_add_tail(&m->m_list, &ss->s_mod_list);
m->m_subsys = ss;
+ return 0;
}
static void __auto_load(struct bmon_module *m)
diff --git a/src/out_format.c b/src/out_format.c
index bfe29a5..19c588f 100644
--- a/src/out_format.c
+++ b/src/out_format.c
@@ -126,10 +126,10 @@ static char *get_token(struct element_group *g, struct element *e,
}
if (!strncasecmp(type, "rx:", 3)) {
- snprintf(buf, len, "%lu", a->a_rx_rate.r_total);
+ snprintf(buf, len, "%llu", a->a_rx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "tx:", 3)) {
- snprintf(buf, len, "%lu", a->a_tx_rate.r_total);
+ snprintf(buf, len, "%llu", a->a_tx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "rxrate:", 7)) {
snprintf(buf, len, "%.2f", a->a_rx_rate.r_rate);