Ethereal-dev: Re: [Ethereal-dev] Re: [Ethereal-cvs] rev 16411: /trunk/: pcap-util-unix.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Wed, 16 Nov 2005 21:08:28 +0100
Guy Harris wrote:

Ulf Lamping wrote:

IMHO it's not a good idea to use eth_close most of the time and only at some places just use close only.

This way:
it's harder to understand why sometimes close and sometimes eth_close is needed
it's hard to find missing wrapper occurrences using grep
if code is copied, it's likely to miss using eth_close when it's needed (but you'll get an error on the Win side, so it's quickly fixed)

Saying all this, if we have a wrapper layer we should use it at all appropriate places, even if it's not required at the specific place.


Even if the descriptor wasn't opened with a wrapper? In pcap-util-unix.c, the descriptor was opened with socket().

Oh, didn't noticed this.

We might not want a wrapper around the socket call :-)

So yes, it's ok to use close here.

Regards, ULFL