]> Dogcows Code - chaz/tar/blobdiff - src/tar.c
(decode_options): Initialize stdlis
[chaz/tar] / src / tar.c
index f122f7abecfefe15c67a3a0eafb0f100405be05c..1e0f95ddd8f42117dd1701f9d642e5538ff0ce33 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -2198,6 +2198,16 @@ decode_options (int argc, char **argv)
       break;
     }
 
+  /* Initialize stdlis */
+  if (index_file_name)
+    {
+      stdlis = fopen (index_file_name, "w");
+      if (! stdlis)
+       open_error (index_file_name);
+    }
+  else
+    stdlis = to_stdout_option ? stderr : stdout;
+
   archive_name_cursor = archive_name_array;
 
   /* Prepare for generating backup names.  */
@@ -2240,6 +2250,9 @@ main (int argc, char **argv)
   /* Make sure we have first three descriptors available */
   stdopen ();
 
+  /* Close all inherited open descriptors, except for the first three */
+  closeopen ();
+  
   /* Pre-allocate a few structures.  */
 
   allocated_archive_names = 10;
This page took 0.019817 seconds and 4 git commands to generate.