summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c
index b07e69ac31..9e9251c854 100644
--- a/bgpd/bgp_io.c
+++ b/bgpd/bgp_io.c
@@ -512,7 +512,13 @@ static uint16_t bgp_read(struct peer_connection *connection, int *code_p)
readsize = MIN(ibuf_work_space, sizeof(ibuf_scratch));
+#ifdef __clang_analyzer__
+ /* clang-SA doesn't want you to call read() while holding a mutex */
+ (void)readsize;
+ nbytes = 0;
+#else
nbytes = read(connection->fd, ibuf_scratch, readsize);
+#endif
/* EAGAIN or EWOULDBLOCK; come back later */
if (nbytes < 0 && ERRNO_IO_RETRY(errno)) {