diff --git a/src/main.c b/src/main.c
index 8ab42f1c194457bc3c5878c6760c90f6be1dc9ec..fcf08190de87e79c1891e27c34e9683d7f14eadc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: main.c,v 1.24 1997/10/27 09:59:22 hubbe Exp $");
+RCSID("$Id: main.c,v 1.25 1997/11/01 23:05:29 grubba Exp $");
 #include "backend.h"
 #include "module.h"
 #include "object.h"
@@ -63,6 +63,13 @@ void main(int argc, char **argv, char **env)
 
   ARGV=argv;
 
+  /* Close extra fds (if any) */
+  for (e=3; e < MAX_OPEN_FILEDESCRIPTORS; e++) {
+    do {
+      num = close(e);
+    } while ((num < 0) && (errno == EINTR));
+  }
+
 #ifdef HAVE_SETLOCALE
 #ifdef LC_NUMERIC
   setlocale(LC_NUMERIC, "C");