]> wimlib.net Git - wimlib/blobdiff - src/capture_common.c
capture_common.c: Add missing breaks in switch stmt in do_capture_progress()
[wimlib] / src / capture_common.c
index 4db070f8ec3aeac1282d98e3565dd8d45533f665..def3a13fe93501e60af9898eeac7cd5f5463f96c 100644 (file)
@@ -30,6 +30,7 @@
 #include "wimlib/error.h"
 #include "wimlib/lookup_table.h"
 #include "wimlib/paths.h"
+#include "wimlib/progress.h"
 #include "wimlib/textfile.h"
 #include "wimlib/wildcard.h"
 
  *     Flags, optional progress function, and progress data for the capture
  *     operation.
  * @status
- *     Status of the scanned file (ok, unsupported, excluded, or excluded
- *     symlink).
+ *     Status of the scanned file.
  * @inode
  *     If @status is WIMLIB_SCAN_DENTRY_OK, this is a pointer to the WIM inode
  *     that has been created for the scanned file.  The first time the file is
  *     seen, inode->i_nlink will be 1.  On subsequent visits of the same inode
  *     via additional hard links, inode->i_nlink will be greater than 1.
  */
-void
+int
 do_capture_progress(struct add_image_params *params, int status,
                    const struct wim_inode *inode)
 {
        switch (status) {
        case WIMLIB_SCAN_DENTRY_OK:
                if (!(params->add_flags & WIMLIB_ADD_FLAG_VERBOSE))
-                       return;
+                       return 0;
+               break;
        case WIMLIB_SCAN_DENTRY_UNSUPPORTED:
        case WIMLIB_SCAN_DENTRY_EXCLUDED:
-       case WIMLIB_SCAN_DENTRY_EXCLUDED_SYMLINK:
+       case WIMLIB_SCAN_DENTRY_FIXED_SYMLINK:
+       case WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK:
                if (!(params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE))
-                       return;
+                       return 0;
+               break;
        }
        params->progress.scan.status = status;
        if (status == WIMLIB_SCAN_DENTRY_OK && inode->i_nlink == 1) {
@@ -84,11 +87,10 @@ do_capture_progress(struct add_image_params *params, int status,
                else
                        params->progress.scan.num_nondirs_scanned++;
        }
+
        /* Call the user-provided progress function.  */
-       if (params->progress_func) {
-               params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
-                                     &params->progress);
-       }
+       return call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
+                            &params->progress, params->progctx);
 }
 
 /*