From 9c0a80425e0d223b7e02256697ce7463317c03e8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 25 May 2013 22:27:48 -0500 Subject: [PATCH] split.c: Declare size_remaining as s64 to handle > 4GB files correctly on 32-bit platforms --- src/resource.c | 12 ++++++------ src/split.c | 6 +----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/resource.c b/src/resource.c index 84d4441b..8705cb1d 100644 --- a/src/resource.c +++ b/src/resource.c @@ -754,8 +754,8 @@ sha1_resource(struct wim_lookup_table_entry *lte) /* * Copies the file resource specified by the lookup table entry @lte from the - * input WIM to the output WIM that has its FILE * given by - * ((WIMStruct*)wim)->out_fp. + * input WIM to the output WIM that has its output file descriptor given by + * ((WIMStruct*)_wim)->out_fd. * * The output_resource_entry, out_refcnt, and part_number fields of @lte are * updated. @@ -763,17 +763,17 @@ sha1_resource(struct wim_lookup_table_entry *lte) * (This function is confusing and should be refactored somehow.) */ int -copy_resource(struct wim_lookup_table_entry *lte, void *wim) +copy_resource(struct wim_lookup_table_entry *lte, void *_wim) { - WIMStruct *w = wim; + WIMStruct *wim = _wim; int ret; - ret = write_wim_resource(lte, w->out_fd, + ret = write_wim_resource(lte, wim->out_fd, wim_resource_compression_type(lte), <e->output_resource_entry, 0); if (ret == 0) { lte->out_refcnt = lte->refcnt; - lte->part_number = w->hdr.part_number; + lte->part_number = wim->hdr.part_number; } return ret; } diff --git a/src/split.c b/src/split.c index 38835d1e..51746250 100644 --- a/src/split.c +++ b/src/split.c @@ -48,7 +48,7 @@ struct split_args { struct list_head lte_list; int cur_part_number; int write_flags; - long size_remaining; + s64 size_remaining; size_t part_size; wimlib_progress_func_t progress_func; union wimlib_progress_info progress; @@ -76,10 +76,6 @@ copy_resource_to_swm(struct wim_lookup_table_entry *lte, void *_args) WIMStruct *wim = args->wim; int ret; - /* metadata resources were already written. */ - if (lte->resource_entry.flags & WIM_RESHDR_FLAG_METADATA) - return 0; - if (args->size_remaining < 0 || (u64)args->size_remaining < lte->resource_entry.size) { -- 2.43.0