aboutsummaryrefslogtreecommitdiff
path: root/archival/cpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/cpio.c')
-rw-r--r--archival/cpio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/archival/cpio.c b/archival/cpio.c
index f0d990048..167931bdb 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -49,7 +49,7 @@
49//config:config FEATURE_CPIO_RENUMBER_INODES 49//config:config FEATURE_CPIO_RENUMBER_INODES
50//config: bool "Support --renumber-inodes like GNU cpio" 50//config: bool "Support --renumber-inodes like GNU cpio"
51//config: default y 51//config: default y
52//config: depends on FEATURE_CPIO_O && LONG_OPTS 52//config: depends on FEATURE_CPIO_O && LONG_OPTS && (PLATFORM_POSIX || FEATURE_EXTRA_FILE_DATA)
53//config: help 53//config: help
54//config: Optionally renumber inodes when creating archives. 54//config: Optionally renumber inodes when creating archives.
55 55
@@ -275,6 +275,7 @@ static NOINLINE int cpio_o(void)
275 if (!(S_ISLNK(st.st_mode) || S_ISREG(st.st_mode))) 275 if (!(S_ISLNK(st.st_mode) || S_ISREG(st.st_mode)))
276 st.st_size = 0; /* paranoia */ 276 st.st_size = 0; /* paranoia */
277 277
278#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
278 /* Store hardlinks for later processing, dont output them */ 279 /* Store hardlinks for later processing, dont output them */
279 if (!S_ISDIR(st.st_mode) && st.st_nlink > 1) { 280 if (!S_ISDIR(st.st_mode) && st.st_nlink > 1) {
280 struct name_s *n; 281 struct name_s *n;
@@ -310,6 +311,7 @@ static NOINLINE int cpio_o(void)
310 free(line); 311 free(line);
311 continue; 312 continue;
312 } 313 }
314#endif
313#if ENABLE_FEATURE_CPIO_RENUMBER_INODES 315#if ENABLE_FEATURE_CPIO_RENUMBER_INODES
314 else if (option_mask32 & OPT_RENUMBER_INODES) { 316 else if (option_mask32 & OPT_RENUMBER_INODES) {
315 st.st_ino = ++G.next_inode; 317 st.st_ino = ++G.next_inode;
@@ -345,10 +347,12 @@ static NOINLINE int cpio_o(void)
345 } 347 }
346 } 348 }
347 349
350#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
348#if ENABLE_FEATURE_CPIO_IGNORE_DEVNO 351#if ENABLE_FEATURE_CPIO_IGNORE_DEVNO
349 if (option_mask32 & OPT_IGNORE_DEVNO) 352 if (option_mask32 & OPT_IGNORE_DEVNO)
350 st.st_dev = st.st_rdev = 0; 353 st.st_dev = st.st_rdev = 0;
351#endif 354#endif
355#endif
352 356
353 bytes += printf("070701" 357 bytes += printf("070701"
354 "%08X%08X%08X%08X%08X%08X%08X" 358 "%08X%08X%08X%08X%08X%08X%08X"