diff --git a/arch/posix/eventloop_posix_eth.c b/arch/posix/eventloop_posix_eth.c index 89705034a..85565ab88 100644 --- a/arch/posix/eventloop_posix_eth.c +++ b/arch/posix/eventloop_posix_eth.c @@ -352,7 +352,7 @@ ETH_connectionSocketCallback(UA_ConnectionManager *cm, UA_RegisteredFD *rfd, /* Receive has failed */ if(ret <= 0) { - if(UA_ERRNO == UA_INTERRUPTED) + if(ret < 0 && UA_ERRNO == UA_INTERRUPTED) return; /* Orderly shutdown of the socket. We can immediately close as no method diff --git a/arch/posix/eventloop_posix_tcp.c b/arch/posix/eventloop_posix_tcp.c index b0fb9b3df..ff5e7aa0a 100644 --- a/arch/posix/eventloop_posix_tcp.c +++ b/arch/posix/eventloop_posix_tcp.c @@ -283,9 +283,9 @@ TCP_connectionSocketCallback(UA_ConnectionManager *cm, TCP_FD *conn, /* Receive has failed */ if(ret <= 0) { - if(UA_ERRNO == UA_INTERRUPTED || - UA_ERRNO == UA_WOULDBLOCK || - UA_ERRNO == UA_AGAIN) + if(ret < 0 && (UA_ERRNO == UA_INTERRUPTED || + UA_ERRNO == UA_WOULDBLOCK || + UA_ERRNO == UA_AGAIN)) return; /* Temporary error on an non-blocking socket */ /* Orderly shutdown of the socket */ diff --git a/arch/posix/eventloop_posix_udp.c b/arch/posix/eventloop_posix_udp.c index 21d12aff5..5ab0669ba 100644 --- a/arch/posix/eventloop_posix_udp.c +++ b/arch/posix/eventloop_posix_udp.c @@ -695,7 +695,7 @@ UDP_connectionSocketCallback(UA_POSIXConnectionManager *pcm, UDP_FD *conn, /* Receive has failed */ if(ret <= 0) { - if(UA_ERRNO == UA_INTERRUPTED) + if(ret < 0 && UA_ERRNO == UA_INTERRUPTED) return; /* Orderly shutdown of the socket. We can immediately close as no method diff --git a/tools/ci/linux/ci.sh b/tools/ci/linux/ci.sh index 4e5ea9fb1..de7b82e2b 100644 --- a/tools/ci/linux/ci.sh +++ b/tools/ci/linux/ci.sh @@ -531,10 +531,18 @@ function build_clang_analyzer { -DUA_FORCE_WERROR=ON \ -DUA_NAMESPACE_ZERO=FULL \ .. + # Disable checkers that produce false positives in the posix eventloop code + local checker_flags="" + if [ "$version" = "21" ]; then + checker_flags="-disable-checker unix.Errno -disable-checker unix.BlockInCriticalSection" + fi scan-build-$version \ --status-bugs \ --exclude ../src/util \ --exclude ../tests \ + --exclude ../examples \ + --exclude ../deps \ + $checker_flags \ make ${MAKEOPTS} }