author | Ruben Kerkhof <ruben@tilaa.nl> | |
Sun, 6 Mar 2016 10:20:42 +0000 (11:20 +0100) | ||
committer | Ruben Kerkhof <ruben@tilaa.nl> | |
Sun, 6 Mar 2016 10:20:42 +0000 (11:20 +0100) |
zfs_arc: 'stolen' was removed after FreeBSD 10.2
34 files changed:
diff --git a/configure.ac b/configure.ac
index 5c6720c3901f3d30a71db162f8e170b405470284..fb9ef34cdc80266d08302f7828802f8c1ee6aecf 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
[#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#if HAVE_STDINT_H
# include <stdint.h>
#endif
])
AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
[#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#if HAVE_STDINT_H
# include <stdint.h>
#endif
diff --git a/src/battery.c b/src/battery.c
index 4178d8b5145f2b728e5c7c949d72ebd8d126a89e..d921484dc74e410191aee2fbc08d37dddfc1db52 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
@@ -111,7 +111,7 @@ static void battery_submit (const char *plugin_instance, const char *type, doubl
} /* void battery_submit */
#if HAVE_IOKIT_PS_IOPOWERSOURCES_H || HAVE_IOKIT_IOKITLIB_H
-double dict_get_double (CFDictionaryRef dict, char *key_string)
+static double dict_get_double (CFDictionaryRef dict, char *key_string)
{
double val_double;
long long val_int;
diff --git a/src/bind.c b/src/bind.c
index f9cf79eca47e9d2a619adc1911223e1f72d58f6d..28d28b68e5fa56fd1584c24f5c2ead252df5dc03 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
for (i = 0; i < zone_nodes->nodesetval->nodeNr; i++)
{
- xmlNode *node;
-
node = zone_nodes->nodesetval->nodeTab[i];
assert (node != NULL);
diff --git a/src/collectdctl.c b/src/collectdctl.c
index 0b8d0c1e89ee1547f955c0795bf388d1568eb518..478f2a4b4172d77079bee5aeecef15c78bd396f8 100644 (file)
--- a/src/collectdctl.c
+++ b/src/collectdctl.c
int status;
while (42) {
- int c;
+ int n;
- c = getopt (argc, argv, "s:h");
+ n = getopt (argc, argv, "s:h");
- if (c == -1)
+ if (n == -1)
break;
- switch (c) {
+ switch (n) {
case 's':
snprintf (address, sizeof (address), "unix:%s", optarg);
address[sizeof (address) - 1] = '\0';
diff --git a/src/dns.c b/src/dns.c
index 1fb7cb8ad7a877b40cb5fe40684c970786113146..3421c475d7e6fc49c2419332dbcd8e5d3dd09f06 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
* Mirko Buffoni <briareos at eswat.org>
**/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include "collectd.h"
diff --git a/src/exec.c b/src/exec.c
index 0445b14a91f879bdfccb2cd44024586741ce5888..d560f465490dae28bb9241fafd04f35444e78625 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
* Peter Holik <peter at holik.at>
**/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE /* For setgroups */
#include "collectd.h"
index 56ccefbf4e26e0e51f77c74f77e376f395db8ef8..bb36c5e66fc5ac8d5b65f135675cc6011b94393c 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
yyset_in (fh);
if (NULL == c_file) {
- int status;
-
status = snprintf (file, sizeof (file), "<fd#%d>", fileno (fh));
if ((status < 0) || (status >= sizeof (file))) {
return (ci_copy);
} /* oconfig_item_t *oconfig_clone */
-void oconfig_free_all (oconfig_item_t *ci)
+static void oconfig_free_all (oconfig_item_t *ci)
{
int i;
diff --git a/src/load.c b/src/load.c
index 0188da7ef38407972f5570f47fabcf622db41b4b..e0c09a3b8cafc78c225ee939cd92d7b8b4522ba5 100644 (file)
--- a/src/load.c
+++ b/src/load.c
* Manuel Sanmartin
**/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include "collectd.h"
diff --git a/src/logfile.c b/src/logfile.c
index 63448cb6c4e9f61cc611c71ed2c37840d160e17e..a7cda3a1ef44c68df1efdf616a7b6cd25af72a57 100644 (file)
--- a/src/logfile.c
+++ b/src/logfile.c
#define APPEND(bufptr, buflen, key, value) \
if ((buflen > 0) && (strlen (value) > 0)) { \
- int status = ssnprintf (bufptr, buflen, ", %s = %s", key, value); \
+ status = ssnprintf (bufptr, buflen, ", %s = %s", key, value); \
if (status > 0) { \
bufptr += status; \
buflen -= status; \
diff --git a/src/network.c b/src/network.c
index ae5ed09652729b2fd7b679d8f90936c07eec59f3..0ee6ed0b9834f96a9ad1cd885657c0e5f9719c89 100644 (file)
--- a/src/network.c
+++ b/src/network.c
* Aman Gupta <aman at tmm1.net>
**/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE /* For struct ip_mreq */
#include "collectd.h"
network_config_ttl = tmp;
else {
WARNING ("network plugin: The `TimeToLive' must be between 1 and 255.");
- return (-1);
+ return (-1);
}
return (0);
diff --git a/src/notify_email.c b/src/notify_email.c
index 24c66ec051b965aa5cbfedd228d774430d951c53..76d48d445825c83834d93095ed35420ce288b7d1 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
/* Initiate a connection to the SMTP server and transfer the message. */
if (!smtp_start_session (session)) {
- char buf[MAXSTRING];
ERROR ("notify_email plugin: SMTP server problem: %s",
smtp_strerror (smtp_errno (), buf, sizeof buf));
pthread_mutex_unlock (&session_lock);
diff --git a/src/ntpd.c b/src/ntpd.c
index f192a826847b6530d30166f9f2a01a4bc672c5db..67fff22a82e026f2b75e5785ddd7904dd8983818 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
* Florian octo Forster <octo at collectd.org>
**/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE /* For NI_MAXHOST */
#include "collectd.h"
/* l_fp to double */
#define M_LFPTOD(r_i, r_uf, d) \
do { \
- register int32_t i; \
- register uint32_t f; \
+ register int32_t ri; \
+ register uint32_t rf; \
\
- i = (r_i); \
- f = (r_uf); \
- if (i < 0) { \
- M_NEG(i, f); \
- (d) = -((double) i + ((double) f) / 4294967296.0); \
+ ri = (r_i); \
+ rf = (r_uf); \
+ if (ri < 0) { \
+ M_NEG(ri, rf); \
+ (d) = -((double) ri + ((double) rf) / 4294967296.0); \
} else { \
- (d) = (double) i + ((double) f) / 4294967296.0; \
+ (d) = (double) ri + ((double) rf) / 4294967296.0; \
} \
} while (0)
poll_s.fd = sd;
poll_s.events = POLLIN | POLLPRI;
poll_s.revents = 0;
-
+
DEBUG ("Polling for %ims", timeout);
status = poll (&poll_s, 1, timeout);
DEBUG ("recv'd %i bytes", status);
- /*
+ /*
* Do some sanity checks first
*/
if (status < RESP_HEADER_SIZE)
@@ -730,7 +731,7 @@ static int ntpd_send_request (int req_code, int req_items, int req_size, char *r
req.err_nitems = ERR_NITEMS (0, req_items);
req.mbz_itemsize = MBZ_ITEMSIZE (req_size);
-
+
if (req_data != NULL)
memcpy ((void *) req.data, (const void *) req_data, req_data_len);
diff --git a/src/perl.c b/src/perl.c
index d247dc0eece612568bce01e2edaee4fdb5326193..945e22586c806e2b3000f18c78e201cbbf74fff4 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
return 0;
if (NULL == aTHX) {
- c_ithread_t *t = NULL;
+ t = NULL;
pthread_mutex_lock (&perl_threads->mutex);
t = c_ithread_create (perl_threads->head->interp);
diff --git a/src/plugin.c b/src/plugin.c
index 6d3d3c9520ac770e4d098475b9c9a22ab14ce8c4..73ec77aba93fa0348e99f75d95f9c24117054972 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
return (status);
}
-static void plugin_free_loaded ()
+static void plugin_free_loaded (void)
{
void *key;
void *value;
void plugin_init_all (void)
{
char const *chain_name;
- long write_threads_num;
llentry_t *le;
int status;
diff --git a/src/plugin.h b/src/plugin.h
index 8f0c6d86105fbfe56547d6b5d78ac9fd7a7f4b26..d54db4bbee49f4dff926c13f77c8cb84b5426fcd 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
int plugin_thread_create (pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
+/*
+ * Plugins need to implement this
+ */
+
+void module_register (void);
+
#endif /* PLUGIN_H */
diff --git a/src/processes.c b/src/processes.c
index c5162081c1dd8aee0a1289bdfcd1b0fd12449419..89e663a57e636315c47687764fdcea2acf64a3ef 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
return (ps);
} /* procstat_t *ps_read_io */
-int ps_read_process (long pid, procstat_t *ps, char *state)
+static int ps_read_process (long pid, procstat_t *ps, char *state)
{
char filename[64];
char buffer[1024];
return buf;
} /* char *ps_get_cmdline (...) */
-static int read_fork_rate ()
+static int read_fork_rate (void)
{
FILE *proc_stat;
char buffer[1024];
diff --git a/src/python.c b/src/python.c
index 44292f90a997de45364ca369ca230e6bb0b5185a..110a8e024a4ea8bcdd25a76dd80892de3e40f6c3 100644 (file)
--- a/src/python.c
+++ b/src/python.c
@@ -386,7 +386,7 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
}
dict = PyDict_New(); /* New reference. */
if (value_list->meta) {
- int i, num;
+ int num;
char **table;
meta_data_t *meta = value_list->meta;
}
#endif
-static int cpy_init_python() {
+static int cpy_init_python(void) {
char *argv = "";
PyObject *sys;
PyObject *module;
diff --git a/src/sensors.c b/src/sensors.c
index 209482e09f88e37a536641bda22d71e2d71810b4..37d335c9da71f2e7f6fc71dbc491734214e07960 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
return (0);
}
-void sensors_free_features (void)
+static void sensors_free_features (void)
{
featurelist_t *thisft;
featurelist_t *nextft;
diff --git a/src/threshold.c b/src/threshold.c
index a70ec8af441f723a1f381b50c8215c6e9c01b89b..c1af40b81e019e967026cf43c3e40be1a97954c1 100644 (file)
--- a/src/threshold.c
+++ b/src/threshold.c
return (0);
} /* }}} int ut_missing */
-int ut_config (oconfig_item_t *ci)
+static int ut_config (oconfig_item_t *ci)
{ /* {{{ */
int i;
int status = 0;
diff --git a/src/tokyotyrant.c b/src/tokyotyrant.c
index 678a341c1ceeaf15f24a708d12567c1b8ed92f15..b618ae323a3e1daec1db5a150c5f81721fdc7bf5 100644 (file)
--- a/src/tokyotyrant.c
+++ b/src/tokyotyrant.c
return (0);
}
-static void printerr()
+static void printerr (void)
{
int ecode = tcrdbecode(rdb);
ERROR ("tokyotyrant plugin: error: %d, %s",
diff --git a/src/types_list.c b/src/types_list.c
index 887b43d87c420d76a823a64452fe788893ff1bd1..41bb4033f39a9f63fde420e5142361e8b0d5ebe2 100644 (file)
--- a/src/types_list.c
+++ b/src/types_list.c
#include "plugin.h"
#include "configfile.h"
+#include "types_list.h"
static int parse_ds (data_source_t *dsrc, char *buf, size_t buf_len)
{
diff --git a/src/utils_avltree.c b/src/utils_avltree.c
index 139d23ace3da91ad5debb7c4278052b1d6aa572b..a9b3862c0ecf4ba5533d0676c3fcdc3d9363a141 100644 (file)
--- a/src/utils_avltree.c
+++ b/src/utils_avltree.c
{
assert (n->right != NULL);
b_bottom = BALANCE (n->right);
- assert ((b_bottom >= -1) || (b_bottom <= 1));
+ assert ((b_bottom >= -1) && (b_bottom <= 1));
if (b_bottom == 1)
n = rotate_right_left (t, n);
else
{
assert (n->left != NULL);
b_bottom = BALANCE (n->left);
- assert ((b_bottom >= -1) || (b_bottom <= 1));
+ assert ((b_bottom >= -1) && (b_bottom <= 1));
if (b_bottom == -1)
n = rotate_left_right (t, n);
else
diff --git a/src/utils_cache.c b/src/utils_cache.c
index 5598f687a7c77b8647d583ed326cb3148b6c061c..8e915883a2a0860b757020e931f18af9cc7ff37b 100644 (file)
--- a/src/utils_cache.c
+++ b/src/utils_cache.c
if (ce->history_length < num_steps)
{
gauge_t *tmp;
- size_t i;
tmp = realloc (ce->history, sizeof (*ce->history)
* num_steps * ce->values_num);
diff --git a/src/utils_cmd_flush.c b/src/utils_cmd_flush.c
index 9a59310a0f405323e60d405a5588a3fb86f17b11..087fee3d5c285f26f0ad2b44428c1d5e30d59fc4 100644 (file)
--- a/src/utils_cmd_flush.c
+++ b/src/utils_cmd_flush.c
#include "common.h"
#include "plugin.h"
#include "utils_parse_option.h"
+#include "utils_cmd_flush.h"
int handle_flush (FILE *fh, char *buffer)
{
diff --git a/src/utils_cmd_getval.c b/src/utils_cmd_getval.c
index 657483b6cf35c6f00bf62afc3e3c71a7c55c0f2f..8d214aad3322d937e5961d4aefbeebc93dc639f0 100644 (file)
--- a/src/utils_cmd_getval.c
+++ b/src/utils_cmd_getval.c
#include "utils_cache.h"
#include "utils_parse_option.h"
+#include "utils_cmd_getval.h"
#define print_to_socket(fh, ...) \
do { \
index bed8462817ea1b2c15a29d663a70cd37fb318b2b..ec91419d8ad523fe3ff37979934663d285e4959c 100644 (file)
--- a/src/utils_cmd_putnotif.c
+++ b/src/utils_cmd_putnotif.c
#include "plugin.h"
#include "utils_parse_option.h"
+#include "utils_cmd_putnotif.h"
#define print_to_socket(fh, ...) \
do { \
diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c
index c9bf48bbeb01184d5192e263bd7f5334c108cebf..a0d20c5ebe03455dbbbb75d691c1af5bf98586ee 100644 (file)
--- a/src/utils_cmd_putval.c
+++ b/src/utils_cmd_putval.c
#include "plugin.h"
#include "utils_parse_option.h"
+#include "utils_cmd_putval.h"
#define print_to_socket(fh, ...) \
do { \
diff --git a/src/utils_db_query.c b/src/utils_db_query.c
index e8d7b3aa88509a5fdf38708470b9615c33aa73bf..6b3c056cb31d6bad732ec133a658c8645a044069 100644 (file)
--- a/src/utils_db_query.c
+++ b/src/utils_db_query.c
/*
* Query private functions
*/
-void udb_query_free_one (udb_query_t *q) /* {{{ */
+static void udb_query_free_one (udb_query_t *q) /* {{{ */
{
if (q == NULL)
return;
diff --git a/src/utils_dns.c b/src/utils_dns.c
index fcc65a56771021e184ce23addd4a508cef3f9622..2b40676353522922446a300343820de422b96497 100644 (file)
--- a/src/utils_dns.c
+++ b/src/utils_dns.c
* Modifications Copyright (C) 2006 Florian octo Forster
* Copyright (C) 2002 The Measurement Factory, Inc.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* Florian octo Forster <octo at verplant.org>
*/
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include "collectd.h"
diff --git a/src/utils_latency.c b/src/utils_latency.c
index 90479741ab857f6013ec8d8aa04fca9bd2c3d1c8..efca6d296b8f743514e023e177325017bdc8d6e5 100644 (file)
--- a/src/utils_latency.c
+++ b/src/utils_latency.c
* Florian Forster <ff at octo.it>
**/
+#include <math.h>
+#include <limits.h>
+
#include "collectd.h"
#include "plugin.h"
#include "utils_latency.h"
#include "common.h"
-#include <math.h>
-#include <limits.h>
-
#ifndef LLONG_MAX
# define LLONG_MAX 9223372036854775807LL
#endif
* So, if the required bin width is 300, then new bin width will be 512 as it is
* the next nearest power of 2.
*/
-void change_bin_width (latency_counter_t *lc, cdtime_t latency) /* {{{ */
+static void change_bin_width (latency_counter_t *lc, cdtime_t latency) /* {{{ */
{
/* This function is called because the new value is above histogram's range.
* First find the required bin width:
CDTIME_T_TO_DOUBLE (new_bin_width));
} /* }}} void change_bin_width */
-latency_counter_t *latency_counter_create () /* {{{ */
+latency_counter_t *latency_counter_create (void) /* {{{ */
{
latency_counter_t *lc;
diff --git a/src/utils_latency.h b/src/utils_latency.h
index 3787c779434c191957fe60a8fefae1063567e9a2..e7c2fc36fcf4eddbe88f3d0211166040b1230fcc 100644 (file)
--- a/src/utils_latency.h
+++ b/src/utils_latency.h
struct latency_counter_s;
typedef struct latency_counter_s latency_counter_t;
-latency_counter_t *latency_counter_create ();
+latency_counter_t *latency_counter_create (void);
void latency_counter_destroy (latency_counter_t *lc);
void latency_counter_add (latency_counter_t *lc, cdtime_t latency);
diff --git a/src/utils_random.c b/src/utils_random.c
index b8738458710786faae5a1745dbbd602b8bb2bad6..548d1d81c81aefadda6f9ee790e05650ddbd0104 100644 (file)
--- a/src/utils_random.c
+++ b/src/utils_random.c
* Florian Forster <octo at collectd.org>
**/
+#include <pthread.h>
+
#include "collectd.h"
#include "utils_time.h"
+#include "utils_random.h"
-#include <pthread.h>
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static _Bool have_seed = 0;
diff --git a/src/utils_subst.c b/src/utils_subst.c
index a49f6db56e8b75307e7790ae1601edb08c2f6b10..ca1e93349e4171950bec5a9b0d1d2fe63fe77211 100644 (file)
--- a/src/utils_subst.c
+++ b/src/utils_subst.c
#include "collectd.h"
#include "common.h"
+#include "utils_subst.h"
char *subst (char *buf, size_t buflen, const char *string, int off1, int off2,
const char *replacement)
diff --git a/src/xmms.c b/src/xmms.c
index 52beb65f8a5d21d32880f81a58be887363390873..51f80d9657953c144b57f15825d6d556b1b940da 100644 (file)
--- a/src/xmms.c
+++ b/src/xmms.c
plugin_dispatch_values (&vl);
} /* void cxmms_submit */
-int cxmms_read (void)
+static int cxmms_read (void)
{
gint rate;
gint freq;