=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_asir.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -p -r1.26 -r1.27 --- OpenXM_contrib2/asir2000/io/ox_asir.c 2001/09/20 10:44:18 1.26 +++ OpenXM_contrib2/asir2000/io/ox_asir.c 2001/09/20 23:11:42 1.27 @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.25 2001/08/20 09:03:26 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.26 2001/09/20 10:44:18 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -715,9 +715,23 @@ void ox_asir_init(int argc,char **argv) void ox_io_init() { unsigned char c,rc; extern int I_am_server; + int i; /* XXX : ssh forwards stdin to a remote host */ - fclose(stdin); +#if defined(linux) || defined(__NeXT__) || defined(ultrix) +#include + close(0); + for ( i = 5; i < NOFILE; i++ ) + close(i); +#else +#include + struct rlimit rl; + + getrlimit(RLIMIT_NOFILE,&rl); + close(0); + for ( i = 5; i < rl.rlim_cur; i++ ) + close(i); +#endif I_am_server = 1; endian_init();