Changeset 4e92740 for examples/erfsplit/erfsplit.c
- Timestamp:
- 10/11/04 13:51:34 (16 years ago)
- 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:
- ef36351d
- Parents:
- d896967f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/erfsplit/erfsplit.c
rc773929 r4e92740 31 31 #include <stdio.h> 32 32 #include <stdlib.h> 33 #include <string.h> 33 34 #include <assert.h> 34 35 #include <string.h> … … 94 95 outfile = stdout; 95 96 } else { 96 if ((outfile = fopen(outputfilename," ab")) == 0) {97 if ((outfile = fopen(outputfilename,"wb")) == 0) { 97 98 perror("fopen"); 98 99 exit(0); … … 106 107 // set up input files 107 108 if ((trace = trace_create(inputuri)) == 0) { 109 printf("trace_create(%s) failed. Bad/nonexistant URI?\n",inputuri); 108 110 exit(0); 109 111 } … … 129 131 if (count > 0) { 130 132 number ++; 131 fwrite( buffer,psize,1,outfile);133 fwrite(packet.buffer,psize,1,outfile); 132 134 if (number > count) { 133 135 fprintf(stderr,"Maximum number of packets reached\n"); … … 149 151 } 150 152 trace_destroy(trace); 153 fclose(outfile); 151 154 return 0; 152 155 }
Note: See TracChangeset
for help on using the changeset viewer.