aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/tar.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 54989b953..3375d1fe9 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -161,7 +161,7 @@ typedef struct TarBallInfo {
161# endif 161# endif
162 HardLinkInfo *hlInfoHead; /* Hard Link Tracking Information */ 162 HardLinkInfo *hlInfoHead; /* Hard Link Tracking Information */
163 HardLinkInfo *hlInfo; /* Hard Link Info for the current file */ 163 HardLinkInfo *hlInfo; /* Hard Link Info for the current file */
164#if !ENABLE_PLATFORM_MINGW32 || ENABLE_FEATURE_EXTRA_FILE_DATA 164#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
165//TODO: save only st_dev + st_ino 165//TODO: save only st_dev + st_ino
166 struct stat tarFileStatBuf; /* Stat info for the tarball, letting 166 struct stat tarFileStatBuf; /* Stat info for the tarball, letting
167 * us know the inode and device that the 167 * us know the inode and device that the
@@ -529,12 +529,14 @@ static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statb
529 } 529 }
530 } 530 }
531 531
532#if !ENABLE_PLATFORM_MINGW32 || ENABLE_FEATURE_EXTRA_FILE_DATA 532#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
533 /* It is a bad idea to store the archive we are in the process of creating, 533 /* It is a bad idea to store the archive we are in the process of creating,
534 * so check the device and inode to be sure that this particular file isn't 534 * so check the device and inode to be sure that this particular file isn't
535 * the new tarball */ 535 * the new tarball */
536 if (tbInfo->tarFileStatBuf.st_dev == statbuf->st_dev 536 if (tbInfo->tarFileStatBuf.st_dev == statbuf->st_dev
537 && tbInfo->tarFileStatBuf.st_ino == statbuf->st_ino 537 && tbInfo->tarFileStatBuf.st_ino == statbuf->st_ino
538 /* ignore invalid inode numbers */
539 && (ENABLE_FEATURE_EXTRA_FILE_DATA && statbuf->st_ino != 0)
538 ) { 540 ) {
539 bb_error_msg("%s: file is the archive; skipping", fileName); 541 bb_error_msg("%s: file is the archive; skipping", fileName);
540 return TRUE; 542 return TRUE;
@@ -707,7 +709,7 @@ static NOINLINE int writeTarFile(
707 709
708 /*tbInfo->hlInfoHead = NULL; - already is */ 710 /*tbInfo->hlInfoHead = NULL; - already is */
709 711
710#if !ENABLE_PLATFORM_MINGW32 || ENABLE_FEATURE_EXTRA_FILE_DATA 712#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
711 /* Store the stat info for the tarball's file, so 713 /* Store the stat info for the tarball's file, so
712 * can avoid including the tarball into itself.... */ 714 * can avoid including the tarball into itself.... */
713 xfstat(tbInfo->tarFd, &tbInfo->tarFileStatBuf, "can't stat tar file"); 715 xfstat(tbInfo->tarFd, &tbInfo->tarFileStatBuf, "can't stat tar file");