]> wimlib.net Git - wimlib/commitdiff
split.c: Declare size_remaining as s64 to handle > 4GB files correctly on 32-bit...
authorEric Biggers <ebiggers3@gmail.com>
Sun, 26 May 2013 03:27:48 +0000 (22:27 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 26 May 2013 03:27:48 +0000 (22:27 -0500)
src/resource.c
src/split.c

index 84d4441bb26add7738f25cee44b3af044e97e145..8705cb1d582d01e19741052fb8e6154216f77ddc 100644 (file)
@@ -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),
                                 &lte->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;
 }
index 38835d1efb9e43c95f88f1493251760f8e2a046e..5174625033c1d299dce7a93a5ad9b084425993e3 100644 (file)
@@ -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) {