Ignore:
Timestamp:
10/11/04 13:51:34 (17 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:
ef36351d
Parents:
d896967f
Message:

poink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/erfsplit/erfsplit.c

    rc773929 r4e92740  
    3131#include <stdio.h>
    3232#include <stdlib.h>
     33#include <string.h>
    3334#include <assert.h>
    3435#include <string.h>
     
    9495                outfile = stdout;
    9596        } else {
    96                 if ((outfile = fopen(outputfilename,"ab")) == 0) {
     97                if ((outfile = fopen(outputfilename,"wb")) == 0) {
    9798                        perror("fopen");
    9899                        exit(0);
     
    106107        // set up input files
    107108        if ((trace = trace_create(inputuri)) == 0) {
     109                printf("trace_create(%s) failed. Bad/nonexistant URI?\n",inputuri);
    108110                exit(0);
    109111        }
     
    129131                if (count > 0) {
    130132                        number ++;
    131                         fwrite(buffer,psize,1,outfile);
     133                        fwrite(packet.buffer,psize,1,outfile);
    132134                        if (number > count)  {
    133135                                fprintf(stderr,"Maximum number of packets reached\n");
     
    149151        }
    150152        trace_destroy(trace);
     153        fclose(outfile);
    151154        return 0;
    152155}
Note: See TracChangeset for help on using the changeset viewer.