busybox-1.4.0-tar.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. --- busybox-1.4.0/archival/tar.c Fri Jan 19 22:23:02 2007
  2. +++ busybox-1.4.0-tar/archival/tar.c Wed Jan 24 21:32:00 2007
  3. @@ -23,10 +23,10 @@
  4. * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  5. */
  6. -#include "busybox.h"
  7. -#include "unarchive.h"
  8. #include <fnmatch.h>
  9. #include <getopt.h>
  10. +#include "busybox.h"
  11. +#include "unarchive.h"
  12. #if ENABLE_FEATURE_TAR_CREATE
  13. @@ -37,6 +37,7 @@
  14. /* POSIX tar Header Block, from POSIX 1003.1-1990 */
  15. #define NAME_SIZE 100
  16. #define NAME_SIZE_STR "100"
  17. +typedef struct TarHeader TarHeader;
  18. struct TarHeader { /* byte offset */
  19. char name[NAME_SIZE]; /* 0-99 */
  20. char mode[8]; /* 100-107 */
  21. @@ -56,7 +57,6 @@
  22. char prefix[155]; /* 345-499 */
  23. char padding[12]; /* 500-512 (pad to exactly the TAR_BLOCK_SIZE) */
  24. };
  25. -typedef struct TarHeader TarHeader;
  26. /*
  27. ** writeTarFile(), writeFileToTarball(), and writeTarHeader() are
  28. @@ -73,6 +73,7 @@
  29. };
  30. /* Some info to be carried along when creating a new tarball */
  31. +typedef struct TarBallInfo TarBallInfo;
  32. struct TarBallInfo {
  33. int tarFd; /* Open-for-write file descriptor
  34. for the tarball */
  35. @@ -85,7 +86,6 @@
  36. HardLinkInfo *hlInfoHead; /* Hard Link Tracking Information */
  37. HardLinkInfo *hlInfo; /* Hard Link Info for the current file */
  38. };
  39. -typedef struct TarBallInfo TarBallInfo;
  40. /* A nice enum with all the possible tar file content types */
  41. enum TarFileType {
  42. @@ -348,7 +348,7 @@
  43. return TRUE;
  44. }
  45. -# if ENABLE_FEATURE_TAR_FROM
  46. +#if ENABLE_FEATURE_TAR_FROM
  47. static int exclude_file(const llist_t *excluded_files, const char *file)
  48. {
  49. while (excluded_files) {
  50. @@ -371,12 +371,12 @@
  51. return 0;
  52. }
  53. -# else
  54. +#else
  55. #define exclude_file(excluded_files, file) 0
  56. -# endif
  57. +#endif
  58. static int writeFileToTarball(const char *fileName, struct stat *statbuf,
  59. - void *userData, int depth)
  60. + void *userData, int depth ATTRIBUTE_UNUSED)
  61. {
  62. struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData;
  63. const char *header_name;
  64. @@ -509,14 +509,14 @@
  65. if (pipe(gzipDataPipe) < 0 || pipe(gzipStatusPipe) < 0)
  66. bb_perror_msg_and_die("pipe");
  67. - signal(SIGPIPE, SIG_IGN); /* we only want EPIPE on errors */
  68. + signal(SIGPIPE, SIG_IGN); /* we only want EPIPE on errors */
  69. -# if __GNUC__
  70. +#if defined(__GNUC__) && __GNUC__
  71. /* Avoid vfork clobbering */
  72. (void) &include;
  73. (void) &errorFlag;
  74. (void) &zip_exec;
  75. -# endif
  76. +#endif
  77. gzipPid = vfork();
  78. @@ -600,7 +600,7 @@
  79. int writeTarFile(const int tar_fd, const int verboseFlag,
  80. const unsigned long dereferenceFlag, const llist_t *include,
  81. const llist_t *exclude, const int gzip);
  82. -#endif /* tar_create */
  83. +#endif /* FEATURE_TAR_CREATE */
  84. #if ENABLE_FEATURE_TAR_FROM
  85. static llist_t *append_file_list_to_list(llist_t *list)
  86. @@ -628,7 +628,7 @@
  87. return newlist;
  88. }
  89. #else
  90. -#define append_file_list_to_list(x) 0
  91. +#define append_file_list_to_list(x) 0
  92. #endif
  93. #if ENABLE_FEATURE_TAR_COMPRESS
  94. @@ -653,7 +653,7 @@
  95. return EXIT_FAILURE;
  96. }
  97. #else
  98. -#define get_header_tar_Z 0
  99. +#define get_header_tar_Z NULL
  100. #endif
  101. #ifdef CHECK_FOR_CHILD_EXITCODE