]> Dogcows Code - chaz/tar/blobdiff - src/buffer.c
Add xz support.
[chaz/tar] / src / buffer.c
index 59d4e4f0c16c4c793f1d97e6fb3c67923fbd1150..a646202a8421323c88cb0ae5865230f89f8a6e05 100644 (file)
@@ -204,7 +204,8 @@ enum compress_type {
   ct_gzip,
   ct_bzip2,
   ct_lzma,
-  ct_lzop
+  ct_lzop,
+  ct_xz
 };
 
 struct zip_magic
@@ -222,8 +223,9 @@ static struct zip_magic const magic[] = {
   { ct_compress, 2, "\037\235", "compress", "-Z" },
   { ct_gzip,     2, "\037\213", "gzip", "-z"  },
   { ct_bzip2,    3, "BZh",      "bzip2", "-j" },
-  { ct_lzma,     6, "\xFFLZMA", "lzma", "-J" }, /* FIXME: ???? */
+  { ct_lzma,     6, "\xFFLZMA", "lzma", "--lzma" }, /* FIXME: ???? */
   { ct_lzop,     4, "\211LZO",  "lzop", "--lzop" },
+  { ct_xz,       6, "\0xFD7zXZ", "-J" },
 };
 
 #define NMAGIC (sizeof(magic)/sizeof(magic[0]))
@@ -848,8 +850,6 @@ close_archive (void)
         flush_archive ();
     }
 
-  sys_drain_input_pipe ();
-
   compute_duration ();
   if (verify_option)
     verify_volume ();
@@ -857,7 +857,7 @@ close_archive (void)
   if (rmtclose (archive) != 0)
     close_error (*archive_name_cursor);
 
-  sys_wait_for_child (child_pid);
+  sys_wait_for_child (child_pid, hit_eof);
 
   tar_stat_destroy (&current_stat_info);
   if (save_name)
@@ -1320,7 +1320,7 @@ _write_volume_label (const char *str)
 
       memset (label, 0, BLOCKSIZE);
 
-      strcpy (label->header.name, volume_label_option);
+      strcpy (label->header.name, str);
       assign_string (&current_stat_info.file_name,
                      label->header.name);
       current_stat_info.had_trailing_slash =
This page took 0.022309 seconds and 4 git commands to generate.