From fc442180da85fa7dd9804a05b8d7d979c383a086 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 14 Jul 2022 03:48:57 +0200 Subject: c-collectd: fixed possible undefined behavior Signed-off-by: Toni Uhlig --- examples/c-collectd/c-collectd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/c-collectd/c-collectd.c') diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c index b9ea95066..3a2c604a8 100644 --- a/examples/c-collectd/c-collectd.c +++ b/examples/c-collectd/c-collectd.c @@ -673,7 +673,7 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock int main(int argc, char ** argv) { - int retval = 1; + int retval = 1, epollfd = -1; openlog("nDPIsrvd-collectd", LOG_CONS, LOG_DAEMON); @@ -720,7 +720,7 @@ int main(int argc, char ** argv) collectd_pid = getppid(); - int epollfd = epoll_create1(0); + epollfd = epoll_create1(0); if (epollfd < 0) { LOG(LOG_DAEMON | LOG_ERR, "Error creating epoll: %s", strerror(errno)); -- cgit v1.2.3