X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Ftar.c;h=1e0f95ddd8f42117dd1701f9d642e5538ff0ce33;hb=8ad985ea6c89f2bb21d4655973ebdb542f7bb39a;hp=f122f7abecfefe15c67a3a0eafb0f100405be05c;hpb=4bf5f6dca4481b8eb9ab67209f085b29787e954a;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index f122f7a..1e0f95d 100644 --- 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;