while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
continue;
+ /* see get_header_cpio */
+ printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
+
return EXIT_SUCCESS;
}
}
case S_IFDIR:
res = mkdir(file_header->name, file_header->mode);
- if ((res == -1) && (errno != EISDIR)
+ if ((res == -1)
+ && (errno != EISDIR) /* btw, Linux doesn't return this */
+ && (errno != EEXIST)
&& !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("cannot make dir %s", file_header->name);
#define hardlinks_to_create (*(hardlinks_t **)(&archive_handle->ah_priv[0]))
#define created_hardlinks (*(hardlinks_t **)(&archive_handle->ah_priv[1]))
+#define block_count (archive_handle->ah_priv[2])
// if (!archive_handle->ah_priv_inited) {
// archive_handle->ah_priv_inited = 1;
// hardlinks_to_create = NULL;
if (strcmp(file_header->name, "TRAILER!!!") == 0) {
/* Always round up. ">> 9" divides by 512 */
- printf("%"OFF_FMT"u blocks\n", (archive_handle->offset + 511) >> 9);
+ block_count = (void*)(ptrdiff_t) ((archive_handle->offset + 511) >> 9);
goto create_hardlinks;
}