diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2024-08-09 11:09:39 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-08-09 11:09:39 +0200 |
commit | 762e6d36bf502cc6445814064fb46f6a8f069c82 (patch) | |
tree | cb73a052385f59880e9d6717e8fca6f05f96ac45 | |
parent | 930aaf92760ea8e350c65af3b71ee34cd3581fa9 (diff) |
Some small fixes.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | examples/c-collectd/c-collectd.c | 6 | ||||
-rw-r--r-- | examples/c-influxd/c-influxd.c | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c index 9f230495a..7d7d65244 100644 --- a/examples/c-collectd/c-collectd.c +++ b/examples/c-collectd/c-collectd.c @@ -213,7 +213,7 @@ static struct nDPIsrvd_ull flow_risk_count[NDPI_MAX_RISK - 1 /* NDPI_NO_RISK */]; nDPIsrvd_ull flow_risk_unknown_count; - } gauges[2]; + } gauges[2]; /* values after InfluxDB push: gauges[0] -= gauges[1], gauges[1] is zero'd afterwards */ } collectd_statistics = {}; struct global_map @@ -421,7 +421,7 @@ static int parse_options(int argc, char ** argv, struct nDPIsrvd_socket * const static char const usage[] = "Usage: %s " - "[-l] [-s host] [-c hostname] [-n collectd-instance-name] [-i interval] [-q]\n\n" + "[-l] [-s host] [-c hostname] [-n collectd-instance-name] [-i interval]\n\n" "\t-l\tLog to console instead of syslog.\n" "\t-s\tDestination where nDPIsrvd is listening on.\n" "\t-c\tCollectd hostname.\n" @@ -430,7 +430,7 @@ static int parse_options(int argc, char ** argv, struct nDPIsrvd_socket * const "\t \tDefaults to: " DEFAULT_COLLECTD_EXEC_INST "\n" "\t-i\tInterval between print statistics to stdout.\n" - "\t \tThis value defaults to the environment variable COLLECTD_INTERVAL.\n"; + "\t \tThis value defaults to the environment variable COLLECTD_INTERVAL.\n\n"; while ((opt = getopt(argc, argv, "hls:c:n:i:")) != -1) { diff --git a/examples/c-influxd/c-influxd.c b/examples/c-influxd/c-influxd.c index 6ab88a9c7..fd4ab8cb0 100644 --- a/examples/c-influxd/c-influxd.c +++ b/examples/c-influxd/c-influxd.c @@ -5,7 +5,6 @@ #include <string.h> #include <sys/epoll.h> #include <sys/timerfd.h> -#include <syslog.h> #include <ndpi_typedefs.h> @@ -1622,7 +1621,6 @@ static void sighandler(int signum) int main(int argc, char ** argv) { - enum nDPIsrvd_connect_return connect_ret; int retval = 1, epollfd = -1; init_logging("nDPIsrvd-influxd"); @@ -1651,8 +1649,7 @@ int main(int argc, char ** argv) strerror(errno)); } - connect_ret = nDPIsrvd_connect(sock); - if (connect_ret != CONNECT_OK) + if (nDPIsrvd_connect(sock) != CONNECT_OK) { logger_early(1, "nDPIsrvd socket connect to %s failed!", serv_optarg); goto failure; |