summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Mohr <alexander.m.mohr@mercedes-benz.com>2023-05-17 08:43:33 +0200
committerGitHub <noreply@github.com>2023-05-17 08:43:33 +0200
commit6005b92b34b3e3ffe43c59be544acd4688a3354c (patch)
tree29eb0bb87296c3f2b5fc82025ce326630a4eb25a /CMakeLists.txt
parentcfc2c86bfec130fb8a95ff0c2553d5c1dd1bd3c1 (diff)
downloadDLT-daemon-6005b92b34b3e3ffe43c59be544acd4688a3354c.tar.gz
dlt_user_shared: Add timeout to writev (#385)
This timeout is necessary to prevent blocking writev indefinitely. Without the timeout dlt-daemon, may block indefinitely when an app id is re-used very frequently. In that case dlt-daemon won't accept anymore new connections and further communication in any way is not possible anymore. Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 413ed96..57044d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,8 @@ option(WITH_DLT_DAEMON_VSOCK_IPC "Set to ON to enable VSOCK support in daemon"
option(WITH_DLT_LIB_VSOCK_IPC "Set to ON to enable VSOCK support in library (DLT_IPC is not used in library)" OFF)
set(DLT_VSOCK_PORT "13490" CACHE STRING "VSOCK port number for logging traffic.")
+set(DLT_WRITEV_TIMEOUT_SEC "1" CACHE STRING "Set sec timeout for writev to prevent blocking indefinitely")
+set(DLT_WRITEV_TIMEOUT_USEC "0" CACHE STRING "Set usec timeout for writev to prevent blocking indefinitely")
# RPM settings
set(GENIVI_RPM_RELEASE "1") # ${DLT_REVISION}")
@@ -135,6 +137,8 @@ include_directories(
)
add_definitions(-D_GNU_SOURCE)
+add_definitions(-DDLT_WRITEV_TIMEOUT_SEC=${DLT_WRITEV_TIMEOUT_SEC})
+add_definitions(-DDLT_WRITEV_TIMEOUT_USEC=${DLT_WRITEV_TIMEOUT_USEC})
if(NOT DLT_IPC STREQUAL "UNIX_SOCKET" AND NOT DLT_IPC STREQUAL "FIFO")
message(FATAL_ERROR "${DLT_IPC} is not a valid value for DLT_IPC")