Changeset 3e89670


Ignore:
Timestamp:
02/17/15 15:34:19 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
8bcc925
Parents:
ed6304c5
Message:

Get the error code from the socket correctly in the case of an error in ring:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_ring.c

    r1ebc4bd r3e89670  
    498498                                return READ_ERROR;
    499499                        } else {
    500                                 /* I've only seen this when the network was down */
    501                                 trace_set_err(libtrace,ENETDOWN,
     500                                /* Try get the error from the socket */
     501                                int err = ENETDOWN;
     502                                socklen_t len = sizeof(err);
     503                                getsockopt(stream->fd, SOL_SOCKET, SO_ERROR,
     504                                           &err, &len);
     505                                trace_set_err(libtrace, err,
    502506                                              "Socket error revents=%d poll()",
    503507                                              pollset[0].revents);
Note: See TracChangeset for help on using the changeset viewer.