summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: debf979)
raw | patch | inline | side by side (parent: debf979)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 31 Oct 2010 16:07:40 +0000 (17:07 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 31 Oct 2010 16:12:28 +0000 (17:12 +0100) |
src/collectd.h | patch | blob | history | |
src/df.c | patch | blob | history | |
src/perl.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history | |
src/rrdtool.c | patch | blob | history |
diff --git a/src/collectd.h b/src/collectd.h
index 8849b30b221ffa776e6e0303acab8b9919e20b02..6faa1a4e0486c7b0ff5c9d47d89746c89c37525f 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#if HAVE_STDINT_H
# include <stdint.h>
#endif
-#if HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-# ifndef HAVE__BOOL
-# ifdef __cplusplus
-typedef bool _Bool;
-# else
-# define _Bool signed char
-# endif
-# endif
-# define bool _Bool
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
-#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
diff --git a/src/df.c b/src/df.c
index b2be8e5eb77a40f55abb499934956eaefe05a3f7..4b3cba019cea9219289cc8adef7633a05e30a9ba 100644 (file)
--- a/src/df.c
+++ b/src/df.c
static ignorelist_t *il_mountpoint = NULL;
static ignorelist_t *il_fstype = NULL;
-static _Bool by_device = false;
-static _Bool report_inodes = false;
+static _Bool by_device = 0;
+static _Bool report_inodes = 0;
static int df_init (void)
{
else if (strcasecmp (key, "ReportByDevice") == 0)
{
if (IS_TRUE (value))
- by_device = true;
+ by_device = 1;
return (0);
}
else if (strcasecmp (key, "ReportInodes") == 0)
{
if (IS_TRUE (value))
- report_inodes = true;
+ report_inodes = 1;
else
- report_inodes = false;
+ report_inodes = 0;
return (0);
}
diff --git a/src/perl.c b/src/perl.c
index afb3ba7e4d81419d3366c67f6a9cedf1d7684959..726058044b80931843069737022b300473dd6ca9 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
#include "configfile.h"
+#if HAVE_STDBOOL_H
+# include <stdbool.h>
+#endif
+
#include <EXTERN.h>
#include <perl.h>
diff --git a/src/plugin.c b/src/plugin.c
index af894d54724c804a0bed9ae512b74fd533f9a18d..65d3875ebe5ae4b211dcc3f38addc3cd9491c26c 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
}
case NM_TYPE_BOOLEAN:
{
- meta->nm_value.nm_boolean = *((bool *) value);
+ meta->nm_value.nm_boolean = *((_Bool *) value);
break;
}
default:
int plugin_notification_meta_add_boolean (notification_t *n,
const char *name,
- bool value)
+ _Bool value)
{
return (plugin_notification_meta_add (n, name, NM_TYPE_BOOLEAN, &value));
}
diff --git a/src/plugin.h b/src/plugin.h
index 8b9449ee1dd64ec76436446bbbbaa9edd38a898b..d78aa4f82ba11c255a6c3c4d053cb4bd1504b38b 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
int64_t nm_signed_int;
uint64_t nm_unsigned_int;
double nm_double;
- bool nm_boolean;
+ _Bool nm_boolean;
} nm_value;
struct notification_meta_s *next;
} notification_meta_t;
double value);
int plugin_notification_meta_add_boolean (notification_t *n,
const char *name,
- bool value);
+ _Bool value);
int plugin_notification_meta_copy (notification_t *dst,
const notification_t *src);
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 4655b96ee77c79a74dca16f9f412bd2df55d3cd7..cb8ad593cbe51d4f9a36f22734fc273c8f724810 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
pthread_mutex_lock (&queue_lock);
/* Wait for values to arrive */
- while (true)
+ while (42)
{
struct timespec ts_wait;
&ts_wait);
if (status == ETIMEDOUT)
break;
- } /* while (true) */
+ } /* while (42) */
/* XXX: If you need to lock both, cache_lock and queue_lock, at
* the same time, ALWAYS lock `cache_lock' first! */