From da7876468f52955c08514229d225390d7b1ce7cd Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 4 Oct 2009 17:08:08 +0200 Subject: [PATCH] tcp_portmon: drop useless function pointer cast, use OBJ_ARG --- src/core.c | 2 +- src/tcp-portmon.c | 6 +----- src/tcp-portmon.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core.c b/src/core.c index 7eb84576..31a0beac 100644 --- a/src/core.c +++ b/src/core.c @@ -1685,7 +1685,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long obj->data.s = strndup(arg, text_buffer_size); #endif /* HDDTEMP */ #ifdef TCP_PORT_MONITOR - END OBJ(tcp_portmon, (void (*)(void))&tcp_portmon_update) + END OBJ_ARG(tcp_portmon, &tcp_portmon_update, "tcp_portmon: needs arguments") tcp_portmon_init(arg, &obj->data.tcp_port_monitor); #endif /* TCP_PORT_MONITOR */ END OBJ(entropy_avail, &update_entropy) diff --git a/src/tcp-portmon.c b/src/tcp-portmon.c index f9fa2296..8513e71b 100644 --- a/src/tcp-portmon.c +++ b/src/tcp-portmon.c @@ -34,9 +34,6 @@ int tcp_portmon_init(const char *arg, struct tcp_port_monitor_data *pmd) memset(itembuf, 0, sizeof(itembuf)); connection_index = 0; /* massive argument checking */ - if (!arg) { - CRIT_ERR(NULL, NULL, "tcp_portmon: needs arguments"); - } argc = sscanf(arg, "%d %d %31s %d", &port_begin, &port_end, itembuf, &connection_index); if ((argc != 3) && (argc != 4)) { @@ -133,10 +130,9 @@ int tcp_portmon_action(char *p, int p_max_size, struct tcp_port_monitor_data *pm return 0; } -int tcp_portmon_update(void) +void tcp_portmon_update(void) { update_tcp_port_monitor_collection(pmc); - return 0; } int tcp_portmon_clear(void) diff --git a/src/tcp-portmon.h b/src/tcp-portmon.h index 8ef40a91..bbaca887 100644 --- a/src/tcp-portmon.h +++ b/src/tcp-portmon.h @@ -37,7 +37,7 @@ struct tcp_port_monitor_data { int tcp_portmon_init(const char *, struct tcp_port_monitor_data *); int tcp_portmon_action(char *, int, struct tcp_port_monitor_data *); -int tcp_portmon_update(void); +void tcp_portmon_update(void); int tcp_portmon_clear(void); int tcp_portmon_set_max_connections(int);