Fix this (a pointer was compared with an integer):
[collectd.git] / src / swap.c
index a6a4e36..0891503 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/swap.c
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * 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
@@ -32,9 +32,9 @@
 # define SWAP_HAVE_READ 0
 #endif
 
-#ifdef KERNEL_SOLARIS
-#include <sys/swap.h>
-#endif /* KERNEL_SOLARIS */
+#if HAVE_SYS_SWAP_H
+# include <sys/swap.h>
+#endif
 
 #undef  MAX
 #define MAX(x,y) ((x) > (y) ? (x) : (y))
@@ -82,8 +82,8 @@ static void swap_submit (unsigned long long swap_used,
 {
        char buffer[512];
 
-       if (snprintf (buffer, 512, "N:%llu:%llu:%llu:%llu", swap_used,
-                               swap_free, swap_cached, swap_resv) >= 512)
+       if (snprintf (buffer, 512, "%u:%llu:%llu:%llu:%llu", (unsigned int) curtime,
+                               swap_used, swap_free, swap_cached, swap_resv) >= 512)
                return;
 
        plugin_submit (MODULE_NAME, "-", buffer);