Changeset 85a0d42 for lib/format_erf.c


Ignore:
Timestamp:
03/17/06 13:23:00 (16 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:
72cc9cc
Parents:
752709f
Message:

Fix up output, better reporting of output errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    reeab9832 r85a0d42  
    688688        int numbytes = 0;
    689689        assert(size<=65536);
    690         /* FIXME: Shouldn't this return != dag_record_size+pad on error? */
    691         if ((numbytes = LIBTRACE_WRITE(OUTPUT.file, erfptr, dag_record_size + pad)) == 0) {
     690
     691        if ((numbytes = LIBTRACE_WRITE(OUTPUT.file, erfptr, dag_record_size + pad)) != dag_record_size+pad) {
    692692                trace_set_err_out(libtrace,errno,
    693693                                "write(%s)",libtrace->uridata);
     
    695695        }
    696696
    697         if ((numbytes=LIBTRACE_WRITE(OUTPUT.file, buffer, size)) == 0) {
     697        if ((numbytes=LIBTRACE_WRITE(OUTPUT.file, buffer, size)) != size) {
    698698                trace_set_err_out(libtrace,errno,
    699699                                "write(%s)",libtrace->uridata);
     
    733733        }
    734734       
    735         if (libtrace->format == &erf 
     735        if (packet->trace->format == &erf 
    736736#if HAVE_DAG
    737                         || libtrace->format == &dag
     737                        || packet->trace->format == &dag
    738738#endif
    739739                        ) {
    740740                numbytes = erf_dump_packet(libtrace,
    741                                 (dag_record_t *)packet->buffer,
     741                                (dag_record_t *)packet->header,
    742742                                pad,
    743743                                payload,
Note: See TracChangeset for help on using the changeset viewer.