diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-19 12:47:34 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-19 12:47:34 +0800 |
commit | de5fe341103fd9e971ca1b67fa65833657558595 (patch) | |
tree | e4d149258bdd9cf0c5416efd7098dd649326c070 /mbbsd | |
parent | 1425375ea3a291730332d631cda7b0abcd396939 (diff) | |
download | pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar.gz pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar.bz2 pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar.lz pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar.xz pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.tar.zst pttbbs-de5fe341103fd9e971ca1b67fa65833657558595.zip |
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
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mbbsd.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 <stdio.h> #include <string.h> #include <stdlib.h> @@ -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"); |