X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fiptables.c;h=8fad588e85120c9bf78d86e0ccf29b3b3ec6092b;hp=286c6e9b6ca4318fa6a1b059e3f1337643434e19;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=3d082a905619c19ca5b7183bb95a30d4d9529c4d diff --git a/src/iptables.c b/src/iptables.c index 286c6e9b..8fad588e 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -86,8 +86,8 @@ typedef struct { char name[64]; } ip_chain_t; -static ip_chain_t **chain_list = NULL; -static int chain_num = 0; +static ip_chain_t **chain_list; +static int chain_num; static int iptables_config(const char *key, const char *value) { /* int ip_value; */ @@ -113,8 +113,7 @@ static int iptables_config(const char *key, const char *value) { value_copy = strdup(value); if (value_copy == NULL) { - char errbuf[1024]; - ERROR("strdup failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("strdup failed: %s", STRERRNO); return 1; } @@ -182,8 +181,7 @@ static int iptables_config(const char *key, const char *value) { list = realloc(chain_list, (chain_num + 1) * sizeof(ip_chain_t *)); if (list == NULL) { - char errbuf[1024]; - ERROR("realloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("realloc failed: %s", STRERRNO); sfree(temp.rule.comment); return 1; } @@ -191,8 +189,7 @@ static int iptables_config(const char *key, const char *value) { chain_list = list; final = malloc(sizeof(*final)); if (final == NULL) { - char errbuf[1024]; - ERROR("malloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("malloc failed: %s", STRERRNO); sfree(temp.rule.comment); return 1; }