]> git.ozlabs.org Git - ppp.git/commitdiff
Close the device fd in device_script() if the channel plugin doesn't
authorPaul Mackerras <paulus@samba.org>
Sun, 24 Oct 2004 23:13:16 +0000 (23:13 +0000)
committerPaul Mackerras <paulus@samba.org>
Sun, 24 Oct 2004 23:13:16 +0000 (23:13 +0000)
have a close function.  Change suggested by Alan Hourihane.

pppd/main.c

index a6fadaa3bd0c0ffd08f9e714235d8e3740f005fb..d53f6412746f081e1796bc1dc17c345435aa1418 100644 (file)
@@ -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 <stdio.h>
 #include <ctype.h>
@@ -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);