]> wimlib.net Git - wimlib/blobdiff - src/extract.c
Add extract_full_stream_to_fd()
[wimlib] / src / extract.c
index abce21f030f0c7776d49f2f4e1ff27aba5e9ceb6..9cbcdb2e054119025cabd22ae0cace0e299bd639 100644 (file)
@@ -1530,8 +1530,8 @@ extract_streams_from_pipe(struct apply_ctx *ctx)
                                if (ret)
                                        goto out_free_found_lte;
 
-                               ret = extract_stream_to_fd(needed_lte, &tmpfile_fd,
-                                                          needed_lte->size);
+                               ret = extract_full_stream_to_fd(needed_lte,
+                                                               &tmpfile_fd);
                                if (ret) {
                                        filedes_close(&tmpfile_fd);
                                        goto delete_tmpfile;
@@ -1651,7 +1651,7 @@ extract_dentry_to_stdout(struct wim_dentry *dentry)
                if (lte) {
                        struct filedes _stdout;
                        filedes_init(&_stdout, STDOUT_FILENO);
-                       ret = extract_stream_to_fd(lte, &_stdout, lte->size);
+                       ret = extract_full_stream_to_fd(lte, &_stdout);
                }
        }
        return ret;
@@ -2391,9 +2391,12 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
        }
 
        if (progress_func) {
-               progress_func(*wim_source_path ? WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN :
-                                                WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN,
-                             &ctx.progress);
+               int msg;
+               if (*wim_source_path || (extract_flags & WIMLIB_EXTRACT_FLAG_PATHMODE))
+                       msg = WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN;
+               else
+                       msg = WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN;
+               progress_func(msg, &ctx.progress);
        }
 
        if (!ctx.root_dentry_is_special)