Changeset cf7cca1 for lib/format_ndag.c


Ignore:
Timestamp:
11/08/18 14:31:51 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop, master
Children:
bc86030
Parents:
8d24b12
Message:

Better fix for unused variable problem in format_ndag.c

The previous one introduced bugs as the init_receivers()
function still needed to be called in all cases, even if the
return value of the function was later unused.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_ndag.c

    r8d24b12 rcf7cca1  
    945945                int *gottime, recvstream_t *rt) {
    946946
    947         int ret, ndagstat;
     947        int ret, ndagstat, avail;
    948948        int toret = 0;
    949949
    950950#if HAVE_DECL_RECVMMSG
    951         int i, avail;
     951        int i;
    952952#endif
    953953
     954        avail = init_receivers(ssock, ssock->bufavail);
    954955
    955956#if HAVE_DECL_RECVMMSG
    956         avail = init_receivers(ssock, ssock->bufavail);
    957957        ret = recvmmsg(ssock->sock, ssock->mmsgbufs, avail,
    958958                        MSG_DONTWAIT, NULL);
    959959#else
     960        if (avail != 1) {
     961                return 0;
     962        }
     963
    960964        ret = recvmsg(ssock->sock, &(ssock->singlemsg), MSG_DONTWAIT);
    961965#endif
Note: See TracChangeset for help on using the changeset viewer.