Changeset de67322


Ignore:
Timestamp:
08/11/05 11:29:53 (15 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
a8ba977
Parents:
9265f72
Message:

better EOF checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/sample/sample.c

    r8cd3901 rde67322  
    7777                filter = trace_bpf_setfilter(filterstring);
    7878
    79         trace_help();
    80         exit(0);
    8179        // open a trace
    8280        trace = trace_create(uri);
     
    8684                unsigned char *x;
    8785                int i;
    88                 if ((psize = trace_read_packet(trace, &packet)) <1) {
    89                         printf("Error or EOF in trace_read_packet\n");
     86                if ((psize = trace_read_packet(trace, &packet)) <0) {
     87                        printf("Error in trace_read_packet\n");
    9088                        break;
    9189                }
     90                if (psize == 0) {
     91                        break;
     92                }
    9293
    9394                if(filter && !trace_bpf_filter(filter,&packet)) {
Note: See TracChangeset for help on using the changeset viewer.