From 1b679271693a17ce0b653b9ba45db77b731db42e Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 6 Nov 2023 12:38:15 +0100 Subject: Event I/O abstraction layer. (#28) * Finalize Event I/O abstraction layer. * Fix possible fd leakage, Gitlab-CI build and error logging. * Fixed possible uninitialized signalfd variable. * Fixed possible memory leak. * Fixed some SonarCloud complaints. * Fixed nDPId-test nDPIsrvd-arpa-mockup stuck indefinitely. * Add nDPId / nDPIsrvd command line option to use poll() on Linux instead of the default epoll(). Signed-off-by: Toni Uhlig --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 94c5ef24b..73d659a5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,10 @@ if(HAS_EPOLL) option(FORCE_POLL "Force the use of poll() instead of epoll()." OFF) if(NOT FORCE_POLL) set(EPOLL_DEFS "-DENABLE_EPOLL=1") - set(EPOLL_SRCS "nio.c") + endif() +else() + if(BUILD_EXAMPLES) + message(FATAL_ERROR "Examples are using epoll event I/O. Without epoll available, you can not build/run those.") endif() endif() @@ -100,8 +103,8 @@ else() unset(NDPI_WITH_MAXMINDDB CACHE) endif() -add_executable(nDPId nDPId.c ${EPOLL_SRCS} utils.c) -add_executable(nDPIsrvd nDPIsrvd.c ${EPOLL_SRCS} utils.c) +add_executable(nDPId nDPId.c nio.c utils.c) +add_executable(nDPIsrvd nDPIsrvd.c nio.c utils.c) add_executable(nDPId-test nDPId-test.c) add_custom_target(dist) -- cgit v1.2.3