On 20 June 2013 20:16, Gert Doering <g...@greenie.muc.de> wrote: > Hi, > > On Thu, Jun 20, 2013 at 07:44:00PM +0300, Nadav Vinik wrote: > > After pcap_close handle is not NULL since the following printf is not > print > > > > thanks > > Nadav > > > > pcap_close(handle); > > if(handle == NULL) { > > In C, this will never ever change the value of "handle", unless > pcap_close() is a macro, which it isn't. > > This is not pascal, we have no way for a function to modify it's > arguments silently (you'd need to pass a pointer, &handle, to achiee > that) >
thanks Hoever if I change to pcap_close(&handle) I get the following error: $ make gcc ./a.c -lpcap ./a.c: In function ‘main’: ./a.c:53:3: warning: passing argument 1 of ‘pcap_close’ from incompatible pointer type [enabled by default] In file included from /usr/include/pcap.h:45:0, from ./a.c:1: /usr/include/pcap/pcap.h:350:6: note: expected ‘struct pcap_t *’ but argument is of type ‘struct pcap_t **’ thanks Nadav > > gert > > -- > USENET is *not* the non-clickable part of WWW! > // > www.muc.de/~gert/ > Gert Doering - Munich, Germany > g...@greenie.muc.de > fax: +49-89-35655025 > g...@net.informatik.tu-muenchen.de > -- הבלוג שלי: http://nadavvin.com _______________________________________________ tcpdump-workers mailing list tcpdump-workers@lists.tcpdump.org https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers