From: Alan T. DeKok Date: Tue, 14 May 2024 21:15:06 +0000 (-0400) Subject: cleanups for coverity complaints about unused code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=084bdb091d6f921fe5e17d0ee2802974ca04c141;p=thirdparty%2Ffreeradius-server.git cleanups for coverity complaints about unused code --- diff --git a/src/lib/bio/fd.c b/src/lib/bio/fd.c index 457a2f059f9..be6b166257b 100644 --- a/src/lib/bio/fd.c +++ b/src/lib/bio/fd.c @@ -147,6 +147,7 @@ static ssize_t fr_bio_fd_read_connected_datagram(fr_bio_t *bio, UNUSED void *pac retry: rcode = read(my->info.socket.fd, buffer, size); + if (rcode == 0) return rcode; #include "fd_read.h" @@ -179,6 +180,8 @@ retry: &sockaddr, salen); } + if (rcode == 0) return rcode; + #include "fd_read.h" return fr_bio_error(IO); @@ -289,6 +292,8 @@ retry: &from, my->msgh.msg_namelen); } + if (rcode == 0) return rcode; + #include "fd_read.h" return fr_bio_error(IO); @@ -429,7 +434,6 @@ static ssize_t fr_bio_fd_sendfromto4(fr_bio_t *bio, void *packet_ctx, const void retry: rcode = sendmsg(my->info.socket.fd, &my->msgh, 0); - if (rcode >= 0) return rcode; #include "fd_write.h" @@ -1137,9 +1141,11 @@ static ssize_t fr_bio_fd_read_discard(fr_bio_t *bio, UNUSED void *packet_ctx, vo retry: rcode = read(my->info.socket.fd, buffer, size); - if (rcode > 0) rcode = 0; /* always return that we read no data */ + if (rcode >= 0) return 0; /* always return that we read no data */ -#include "fd_read.h" +#undef flag_blocked +#define flag_blocked read_blocked +#include "fd_errno.h" return fr_bio_error(IO); }