Merge pull request #3329 from efuss/fix-3311
[collectd.git] / src / irq.c
index d540415..9156356 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
@@ -23,9 +23,9 @@
 
 #include "collectd.h"
 
-#include "common.h"
 #include "plugin.h"
-#include "utils_ignorelist.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
 
 #if !KERNEL_LINUX
 #error "No applicable input method."
@@ -37,7 +37,7 @@
 static const char *config_keys[] = {"Irq", "IgnoreSelected"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
 
 /*
  * Private functions
@@ -90,9 +90,7 @@ static int irq_read(void) {
    */
   fh = fopen("/proc/interrupts", "r");
   if (fh == NULL) {
-    char errbuf[1024];
-    ERROR("irq plugin: fopen (/proc/interrupts): %s",
-          sstrerror(errno, errbuf, sizeof(errbuf)));
+    ERROR("irq plugin: fopen (/proc/interrupts): %s", STRERRNO);
     return -1;
   }
 
@@ -140,7 +138,7 @@ static int irq_read(void) {
     if (irq_name_len == 4 && (strncmp(irq_name, "FIQ:", 4) == 0))
       continue;
 
-    irq_name[irq_name_len - 1] = 0;
+    irq_name[irq_name_len - 1] = '\0';
     irq_name_len--;
 
     irq_value = 0;