Changeset 997ba1d9 in rtems


Ignore:
Timestamp:
09/16/22 17:07:18 (4 months ago)
Author:
Frank Kühndel <frank.kuehndel@…>
Branches:
master
Children:
1c189e1a
Parents:
c46fbb9
git-author:
Frank Kühndel <frank.kuehndel@…> (09/16/22 17:07:18)
git-committer:
Joel Sherrill <joel@…> (12/02/22 15:32:01)
Message:

tftpDriver.c: Fix Coverity issues

CID 1506523: Unchecked return value from library (CHECKED_RETURN)
CID 1506522: Unchecked return value from library (CHECKED_RETURN)
CID 1437618: Unchecked return value from library (CHECKED_RETURN)

Close #4718

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/ftpfs/tftpDriver.c

    rc46fbb9 r997ba1d9  
    526526    /*
    527527     * Send it
    528      */
    529     sendto (tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, sizeof *to);
     528     *
     529     * Ignoring result because error packets are sent once and maybe lost.
     530     */
     531    (void) sendto (tp->socket, (char *)&msg, len, 0, (struct sockaddr *)to, sizeof *to);
    530532}
    531533
     
    553555        tv.tv_sec = tp->config.first_timeout / 1000L;
    554556        tv.tv_usec = (tp->config.first_timeout % 1000L) * 1000L;
    555         setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
     557        /*
     558         * Ignoring result because all possible errors indicate wrong
     559         * arguments and these arguments are OK as tested by test suite.
     560         */
     561        (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,
     562            sizeof tv);
    556563    } else {
    557564        tv.tv_sec = tp->config.timeout / 1000L;
    558565        tv.tv_usec = (tp->config.timeout % 1000L) * 1000L;
    559         setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
     566        /*
     567         * Ignoring result because all possible errors indicate wrong
     568         * arguments and these arguments are OK as tested by test suite.
     569         */
     570        (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,
     571            sizeof tv);
    560572    }
    561573    for (;;) {
     
    592604        tv.tv_sec = 0;
    593605        tv.tv_usec = 0;
    594         setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
     606        /*
     607         * Ignoring result because all possible errors indicate wrong
     608         * arguments and these arguments are OK as tested by test suite.
     609         */
     610        (void) setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv,
     611            sizeof tv);
    595612    }
    596613    return len;
     
    725742         * Send it. Errors during send will not matter for this last ACK.
    726743         */
    727         sendto (
     744        (void) sendto (
    728745            tp->socket,
    729746            send_buf,
Note: See TracChangeset for help on using the changeset viewer.