From de5fe341103fd9e971ca1b67fa65833657558595 Mon Sep 17 00:00:00 2001 From: in2 Date: Tue, 19 Mar 2002 04:47:34 +0000 Subject: if bbs abort, close all file descriptors(including network connection) first git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@50 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 6e4f7e90..59cc974f 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.12 2002/03/16 15:44:01 ptt Exp $ */ +/* $Id: mbbsd.c,v 1.13 2002/03/19 04:47:34 in2 Exp $ */ #include #include #include @@ -252,6 +252,10 @@ abort_bbs_debug (int sig) static int reentrant = 0; if (!reentrant){ + int i; + /* close all file descriptors (including the network connection) */ + for( i = 0 ; i < 256 ; ++i ) + close(i); reentrant = 1; if (currmode) u_exit ("AXXED"); -- cgit v1.2.3