get_header_tar_bz2.c 669 B

123456789101112131415161718192021222324252627
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  4. */
  5. #include <sys/types.h>
  6. #include <sys/wait.h>
  7. #include <signal.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <unistd.h>
  12. #include "libbb.h"
  13. #include "unarchive.h"
  14. char get_header_tar_bz2(archive_handle_t *archive_handle)
  15. {
  16. /* Can't lseek over pipes */
  17. archive_handle->seek = seek_by_read;
  18. archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
  19. archive_handle->offset = 0;
  20. while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
  21. /* Can only do one file at a time */
  22. return EXIT_FAILURE;
  23. }