On Thu, Jun 27, 2024 at 01:45:34AM +0200, Stefano Brivio wrote: > Spotted by Coverity, harmless as we would consider that successful > and check on the socket later from the timer, but printing a debug > message in that case is definitely wise, should it ever happen. > > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp_splice.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/tcp_splice.c b/tcp_splice.c > index 5a406c6..f2d4fc6 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -598,11 +598,16 @@ eintr: > readlen > (long)c->tcp.pipe_size / 10) { > int lowat = c->tcp.pipe_size / 4; > > - setsockopt(conn->s[fromside], SOL_SOCKET, > - SO_RCVLOWAT, &lowat, sizeof(lowat)); > - > - conn_flag(c, conn, lowat_set_flag); > - conn_flag(c, conn, lowat_act_flag); > + if (setsockopt(conn->s[fromside], SOL_SOCKET, > + SO_RCVLOWAT, > + &lowat, sizeof(lowat))) { > + flow_trace(conn, > + "Setting SO_RCVLOWAT %i: %s", > + lowat, strerror(errno)); > + } else { > + conn_flag(c, conn, lowat_set_flag); > + conn_flag(c, conn, lowat_act_flag); > + } > } > > break; -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson