From 1c3ef69faa6927ac732a079c7f8efcb20bf1020e Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 15 Mar 2021 14:09:20 +0100 Subject: nDPIsrvd collectd-exec overhaul. * Install targets updated. * Removed nDPIsrvd.h token validation function (done automatically by token_get). Signed-off-by: Toni Uhlig --- nDPIsrvd.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'nDPIsrvd.c') diff --git a/nDPIsrvd.c b/nDPIsrvd.c index 082a5c53a..0d51bce00 100644 --- a/nDPIsrvd.c +++ b/nDPIsrvd.c @@ -719,20 +719,22 @@ int main(int argc, char ** argv) goto error; } - struct epoll_event accept_event = {}; - accept_event.data.fd = json_sockfd; - accept_event.events = EPOLLIN; - if (epoll_ctl(epollfd, EPOLL_CTL_ADD, json_sockfd, &accept_event) < 0) { - syslog(LOG_DAEMON | LOG_ERR, "Error adding JSON fd to epoll: %s", strerror(errno)); - goto error; + struct epoll_event accept_event = {.data.fd = json_sockfd, .events = EPOLLIN}; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, json_sockfd, &accept_event) < 0) + { + syslog(LOG_DAEMON | LOG_ERR, "Error adding JSON fd to epoll: %s", strerror(errno)); + goto error; + } } - accept_event.data.fd = serv_sockfd; - accept_event.events = EPOLLIN; - if (epoll_ctl(epollfd, EPOLL_CTL_ADD, serv_sockfd, &accept_event) < 0) + { - syslog(LOG_DAEMON | LOG_ERR, "Error adding INET fd to epoll: %s", strerror(errno)); - goto error; + struct epoll_event accept_event = {.data.fd = serv_sockfd, .events = EPOLLIN}; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, serv_sockfd, &accept_event) < 0) + { + syslog(LOG_DAEMON | LOG_ERR, "Error adding INET fd to epoll: %s", strerror(errno)); + goto error; + } } retval = mainloop(epollfd); -- cgit v1.2.3