<div dir="auto">I'm ok with this.<div dir="auto"><br></div><div dir="auto">FYI Coverity Scans are limited to three times a day but a check for changes runs more frequently to trigger them.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 16, 2022, 1:13 PM Frank Kuehndel <<a href="mailto:frank.kuehndel@embedded-brains.de">frank.kuehndel@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Frank Kühndel <<a href="mailto:frank.kuehndel@embedded-brains.de" target="_blank" rel="noreferrer">frank.kuehndel@embedded-brains.de</a>><br>
<br>
CID 1506523: Unchecked return value from library (CHECKED_RETURN)<br>
CID 1506522: Unchecked return value from library (CHECKED_RETURN)<br>
CID 1437618: Unchecked return value from library (CHECKED_RETURN)<br>
<br>
Close #4718<br>
---<br>
cpukit/libfs/src/ftpfs/tftpDriver.c | 27 ++++++++++++++++++++++-----<br>
1 file changed, 22 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/cpukit/libfs/src/ftpfs/tftpDriver.c b/cpukit/libfs/src/ftpfs/tftpDriver.c<br>
index 59136ef59f..0246ed9611 100644<br>
--- a/cpukit/libfs/src/ftpfs/tftpDriver.c<br>
+++ b/cpukit/libfs/src/ftpfs/tftpDriver.c<br>
@@ -525,8 +525,10 @@ static void send_error (<br>
<br>
/*<br>
* Send it<br>
+ *<br>
+ * Ignoring result because error packets are sent once and maybe lost.<br>
*/<br>
- sendto (tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, sizeof *to);<br>
+ (void) sendto (tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, sizeof *to);<br>
}<br>
<br>
/*<br>
@@ -552,11 +554,21 @@ getPacket (struct tftpStream *tp, int retryCount)<br>
} else if (retryCount == 0) {<br>
tv.tv_sec = tp->config.first_timeout / 1000L;<br>
tv.tv_usec = (tp->config.first_timeout % 1000L) * 1000L;<br>
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);<br>
+ /*<br>
+ * Ignoring result because all possible errors indicate wrong<br>
+ * arguments and these arguments are OK as tested by test suite.<br>
+ */<br>
+ (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,<br>
+ sizeof tv);<br>
} else {<br>
tv.tv_sec = tp->config.timeout / 1000L;<br>
tv.tv_usec = (tp->config.timeout % 1000L) * 1000L;<br>
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);<br>
+ /*<br>
+ * Ignoring result because all possible errors indicate wrong<br>
+ * arguments and these arguments are OK as tested by test suite.<br>
+ */<br>
+ (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,<br>
+ sizeof tv);<br>
}<br>
for (;;) {<br>
union {<br>
@@ -591,7 +603,12 @@ getPacket (struct tftpStream *tp, int retryCount)<br>
if (retryCount != GET_PACKET_DONT_WAIT) {<br>
tv.tv_sec = 0;<br>
tv.tv_usec = 0;<br>
- setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);<br>
+ /*<br>
+ * Ignoring result because all possible errors indicate wrong<br>
+ * arguments and these arguments are OK as tested by test suite.<br>
+ */<br>
+ (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,<br>
+ sizeof tv);<br>
}<br>
return len;<br>
}<br>
@@ -724,7 +741,7 @@ static int process_data_packet (struct tftpStream *tp, ssize_t len)<br>
/*<br>
* Send it. Errors during send will not matter for this last ACK.<br>
*/<br>
- sendto (<br>
+ (void) sendto (<br>
tp->socket,<br>
send_buf,<br>
plen,<br>
-- <br>
2.35.3<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div>