summaryrefslogtreecommitdiff
path: root/examples/c-collectd
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-07-14 03:48:57 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-07-14 03:48:57 +0200
commitfc442180da85fa7dd9804a05b8d7d979c383a086 (patch)
treefe37e50ed93b99e8af4646f43aefba2e6b32b75b /examples/c-collectd
parenta606586a32e1bc065a182ae1973d2565f472ec8d (diff)
c-collectd: fixed possible undefined behavior
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-collectd')
-rw-r--r--examples/c-collectd/c-collectd.c4
1 files changed, 2 insertions, 2 deletions
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));