]> wimlib.net Git - wimlib/blobdiff - src/join.c
Use __builtin_bswap64() only if supported
[wimlib] / src / join.c
index 8bdd24be83605b1ad9a7c71bfd6200f24e8424cb..a6e8c9cb9e523a9290c0eae45580f2c0a09f4f5d 100644 (file)
@@ -272,7 +272,8 @@ static int join_wims(WIMStruct **swms, uint num_swms, WIMStruct *joined_wim,
         * attached to it.  */
        swms[0]->hdr.flags &= ~WIM_HDR_FLAG_SPANNED;
        swms[0]->hdr.total_parts = 1;
-       return finish_write(swms[0], WIM_ALL_IMAGES, write_flags, 0);
+       return finish_write(swms[0], WIM_ALL_IMAGES,
+                           write_flags | WIMLIB_WRITE_FLAG_NO_LOOKUP_TABLE);
 }
 
 
@@ -328,14 +329,13 @@ WIMLIBAPI int wimlib_join(const char **swm_names, unsigned num_swms,
                goto out;
        ret = join_wims(swms, num_swms, joined_wim, write_flags);
 out:
+       /* out_fp is the same in all the swms and joined_wim.  And it was
+        * already closed in the call to finish_write(). */
        for (i = 0; i < num_swms; i++) {
-               /* out_fp is the same in all the swms and joined_wim; only close
-                * it one time, when freeing joined_wim. */
-               if (swms[i]) {
-                       swms[i]->out_fp = NULL;
-                       wimlib_free(swms[i]);
-               }
+               swms[i]->out_fp = NULL;
+               wimlib_free(swms[i]);
        }
+       joined_wim->out_fp = NULL;
        wimlib_free(joined_wim);
        return ret;
 }