win32_capture.c: Exclude files pending deletion
authorEric Biggers <ebiggers3@gmail.com>
Thu, 26 Jun 2014 00:43:00 +0000 (19:43 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 26 Jun 2014 00:43:00 +0000 (19:43 -0500)
src/win32_capture.c

index 6223ed26135acb26fc4da3d7d139998bc982b5f6..4bccfa1412f6c4902f8551f4cc0e5f806db754fa 100644 (file)
@@ -1110,11 +1110,19 @@ winnt_build_dentry_tree_recursive(struct wim_dentry **root_ret,
                                        SYNCHRONIZE,
                              &h);
        if (unlikely(!NT_SUCCESS(status))) {
-               set_errno_from_nt_status(status);
-               ERROR_WITH_ERRNO("\"%ls\": Can't open file "
-                                "(status=0x%08"PRIx32")",
-                                printable_path(full_path), (u32)status);
-               ret = WIMLIB_ERR_OPEN;
+               if (status == STATUS_DELETE_PENDING) {
+                       WARNING("\"%ls\": Deletion pending; skipping file",
+                               printable_path(full_path));
+                       ret = 0;
+               } else {
+                       set_errno_from_nt_status(status);
+                       ERROR_WITH_ERRNO("\"%ls\": Can't open file "
+                                        "(status=0x%08"PRIx32")",
+                                        printable_path(full_path), (u32)status);
+                       ret = WIMLIB_ERR_OPEN;
+               }
+               /* XXX: Provide option to exclude files that fail with
+                * STATUS_SHARING_VIOLATION?  */
                goto out;
        }