On Wed, Aug 24, 2011 at 01:41:15PM +0200, Holger Hans Peter Freyther wrote:
On 08/24/2011 09:49 AM, Harald Welte wrote:
+ if (bfd->fd) {
+ close(bfd->fd);
+ bfd->fd = 0;
+ }
maybe using -1 for 'invalid' fd's is better?
"-1" already has a different meaning in the same part of the code, it
means that there was some error in return to "open"
But yes, we could do "-2" or store the open result in a variable rather
than a structure member. Feel free to do a follow-up patch ;)
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org>
http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)