Changeset 5b4404a


Ignore:
Timestamp:
05/23/06 13:28:26 (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:
46dd1e3
Parents:
11c4044
Message:

Use binary mode for windows
At EOF return EOF not a bogus error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    rdeed208 r5b4404a  
    321321                char buffer[PATH_MAX];
    322322                snprintf(buffer,sizeof(buffer),"%s.idx",libtrace->uridata);
    323                 DATA(libtrace)->seek.index=libtrace_io_open(buffer,"r");
     323                DATA(libtrace)->seek.index=libtrace_io_open(buffer,"rb");
    324324                if (DATA(libtrace)->seek.index) {
    325325                        DATA(libtrace)->seek.exists=INDEX_EXISTS;
     
    702702                                        buffer2,
    703703                                        size)) != size) {
    704                 trace_set_err(libtrace,errno, "read(%s)", libtrace->uridata);
    705                 return -1;
     704                if (numbytes==-1) {
     705                        trace_set_err(libtrace,errno, "read(%s)", libtrace->uridata);
     706                        return -1;
     707                }
     708                /* Failed to read the full packet?  must be EOF */
     709                return 0;
    706710        }
    707711        if (((dag_record_t *)packet->buffer)->flags.rxerror == 1) {
Note: See TracChangeset for help on using the changeset viewer.