From b5bdcebbce10f44919989443371fbb2e069074b0 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 14 May 2026 16:57:38 +0200 Subject: [PATCH] Fixed (some) issues reported by SonarCloud Signed-off-by: Toni Uhlig --- Dockerfile | 2 +- nDPId.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8493935c..e73e1b9fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /root RUN apt-get -y update \ && apt-get install -y --no-install-recommends \ autoconf automake build-essential ca-certificates cmake git \ - libpcap-dev libcurl4-openssl-dev libdbus-1-dev libtool make pkg-config unzip wget \ + libcurl4-openssl-dev libdbus-1-dev libpcap-dev libtool make pkg-config unzip wget \ && apt-get clean \ && git clone https://github.com/utoni/nDPId.git diff --git a/nDPId.c b/nDPId.c index b9efa0bbf..d8d6df822 100644 --- a/nDPId.c +++ b/nDPId.c @@ -670,7 +670,9 @@ static int set_collector_nonblock(struct nDPId_reader_thread * const reader_thre { int current_flags; - while ((current_flags = fcntl(reader_thread->collector_sockfd, F_GETFL, 0)) == -1 && errno == EINTR) {} + while ((current_flags = fcntl(reader_thread->collector_sockfd, F_GETFL, 0)) == -1 && errno == EINTR) { + // Retry if interrupted by a signal. + } if (current_flags == -1) { reader_thread->collector_sock_last_errno = errno; logger(1, @@ -704,7 +706,9 @@ static int set_collector_block(struct nDPId_reader_thread * const reader_thread) { int current_flags; - while ((current_flags = fcntl(reader_thread->collector_sockfd, F_GETFL, 0)) == -1 && errno == EINTR) {} + while ((current_flags = fcntl(reader_thread->collector_sockfd, F_GETFL, 0)) == -1 && errno == EINTR) { + // Retry if interrupted by a signal. + } if (current_flags == -1) { reader_thread->collector_sock_last_errno = errno; logger(1,