Ignore:
Timestamp:
11/16/17 10:37:56 (3 years ago)
Author:
Robert A Zeh <razeh@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
9726d0e
Parents:
be32cc7
git-author:
Robert A Zeh <robert.a.zeh@…> (11/16/17 10:36:16)
git-committer:
Robert A Zeh <razeh@…> (11/16/17 10:37:56)
Message:

Add TRACE_ERR_WANDIO_FAILED for wandio error reporting.

Passing an errcode of 0 to trace_set_err triggers the assertion at
format_helper.c:290, making the error unrecoverable for the calling
code. This happens when the wandio layer encounters an error while
errno is still 0 (for example, an incomplete pcap packet).

To make the error recoverable, pass in TRACE_ERR_WANDIO_FAILED instead
of errno.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_legacy.c

    ree6e802 r2c457ec  
    269269                                                (size_t)64)) != 64) {
    270270                        if (numbytes < 0) {
    271                                 trace_set_err(libtrace,errno,"read(%s)",libtrace->uridata);
     271                                trace_set_err(libtrace,TRACE_ERR_WANDIO_FAILED,"read(%s)",libtrace->uridata);
    272272                        } else if (numbytes > 0) {
    273273                               
     
    310310                                                (size_t)68)) != 68) {
    311311                        if (numbytes < 0) {
    312                                 trace_set_err(libtrace,errno,"read(%s)",libtrace->uridata);
     312                                trace_set_err(libtrace,TRACE_ERR_WANDIO_FAILED,"read(%s)",libtrace->uridata);
    313313                        } else if (numbytes > 0)
    314314                                continue;
Note: See TracChangeset for help on using the changeset viewer.