From: Paul Mackerras Date: Sun, 24 Oct 2004 23:13:16 +0000 (+0000) Subject: Close the device fd in device_script() if the channel plugin doesn't X-Git-Tag: ppp-2.4.7~235 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=f7f0914953764891c15ae3307444fb6bacb90a21 Close the device fd in device_script() if the channel plugin doesn't have a close function. Change suggested by Alan Hourihane. --- diff --git a/pppd/main.c b/pppd/main.c index a6fadaa..d53f641 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: main.c,v 1.136 2004/04/12 11:20:19 paulus Exp $" +#define RCSID "$Id: main.c,v 1.137 2004/10/24 23:13:16 paulus Exp $" #include #include @@ -1575,6 +1575,8 @@ device_script(program, in, out, dont_wait) close(2); if (the_channel->close) (*the_channel->close)(); + else + close(devfd); /* some plugins don't have a close function */ closelog(); close(fd_devnull);