Bladeren bron

(main): Move closeopen after decode_options to allow shell process substitution to work.

Sergey Poznyakoff 18 jaren geleden
bovenliggende
commit
d989864712
1 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 4 3
      src/tar.c

+ 4 - 3
src/tar.c

@@ -2302,9 +2302,6 @@ 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;
@@ -2322,6 +2319,10 @@ main (int argc, char **argv)
   /* Decode options.  */
 
   decode_options (argc, argv);
+
+  /* Close all inherited open descriptors, except for the first three */
+  closeopen ();
+
   name_init ();
 
   /* Main command execution.  */