Changeset 575c531 for lib/format_duck.c


Ignore:
Timestamp:
06/23/06 12:02:54 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, 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:
38ff7c9
Parents:
873558d
Message:

Better error reporting with format_duck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_duck.c

    r162d976 r575c531  
    185185        if ((numbytes = libtrace_io_read(INPUT->file, packet->payload,
    186186                                        duck_size)) != duck_size) {
    187                 if (numbytes != 0) {
     187                if (numbytes == -1) {
    188188                        trace_set_err(libtrace, errno, "Reading DUCK failed");
    189189                        return -1;
    190190                }
    191                 return 0;
     191                else if (numbytes == 0) {
     192                        return 0;
     193                }
     194                else {
     195                        trace_set_err(libtrace, TRACE_ERR_BAD_PACKET, "Truncated DUCK packet");
     196                }
    192197        }
    193198
Note: See TracChangeset for help on using the changeset viewer.