Re: make rdaemon less error-prone

2016-09-24 Thread Jeremie Courreges-Anglas
j...@wxcvbn.org (Jeremie Courreges-Anglas) writes: > Simple idiom: always initialize the pre-opened fd to -1, and within > rdaemon() test whether the passed fd is valid. > > ok? Updated diff after Theo suggested avoiding the fcntl call if possible. Index: usr.sbin/rtadvd/rtadvd.c ==

make rdaemon less error-prone

2016-09-24 Thread Jeremie Courreges-Anglas
Simple idiom: always initialize the pre-opened fd to -1, and within rdaemon() test whether the passed fd is valid. ok? Index: usr.sbin/dhcrelay/dhcrelay.c === RCS file: /cvs/src/usr.sbin/dhcrelay/dhcrelay.c,v retrieving revision 1.