tcp_portmon: drop useless function pointer cast, use OBJ_ARG
authorPhil Sutter <phil@nwl.cc>
Sun, 4 Oct 2009 15:08:08 +0000 (17:08 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 12 Oct 2009 19:33:02 +0000 (21:33 +0200)
src/core.c
src/tcp-portmon.c
src/tcp-portmon.h

index 7eb8457..31a0bea 100644 (file)
@@ -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)
index f9fa229..8513e71 100644 (file)
@@ -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)
index 8ef40a9..bbaca88 100644 (file)
@@ -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);