[ovs-dev] [arp-rw 05/13] pcap-file: Add support for append mode to pcap_open().
Alex Wang
alexw at nicira.com
Tue Oct 8 23:04:12 UTC 2013
Yes, it makes sense, thanks for the explanation,
On Tue, Oct 8, 2013 at 3:47 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, Oct 08, 2013 at 02:02:28PM -0700, Alex Wang wrote:
> > + case 'a':
> > > + if (!fstat(fileno(file), &s) && !s.st_size) {
> > > + pcap_write_header(file);
> > > + }
> > > + break;
> > > +
> > > + default:
> > > + NOT_REACHED();
> > > }
> > >
> >
> > Here, why do we check the (!st_size)? don't we allow append to empty
> file?
>
> We can append to an empty file, but if the file isn't empty then we
> shouldn't try to write a pcap file header at the beginning.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20131008/179a54f8/attachment-0003.html>
More information about the dev
mailing list