Browse Source

close standard in

David Rose 23 years ago
parent
commit
89e070b6ce
1 changed files with 4 additions and 0 deletions
  1. 4 0
      direct/src/autorestart/autorestart.c

+ 4 - 0
direct/src/autorestart/autorestart.c

@@ -26,6 +26,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <string.h>  /* for strerror */
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -327,6 +328,9 @@ main(int argc, char *argv[]) {
     fprintf(stderr, "Generating output to %s.\n", logfile_name);
   }
 
+  /* Make sure standard input is closed. */
+  close(STDIN_FILENO);
+
   double_fork();
 
   return 0;