git://wimlib.net
/
wimlib
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bdea6a2
)
Report directory tree scan errors
author
Eric Biggers
<ebiggers3@gmail.com>
Wed, 22 Oct 2014 03:18:05 +0000
(22:18 -0500)
committer
Eric Biggers
<ebiggers3@gmail.com>
Wed, 22 Oct 2014 03:25:29 +0000
(22:25 -0500)
include/wimlib.h
patch
|
blob
|
history
include/wimlib/capture.h
patch
|
blob
|
history
src/ntfs-3g_capture.c
patch
|
blob
|
history
src/unix_capture.c
patch
|
blob
|
history
src/win32_capture.c
patch
|
blob
|
history
diff --git
a/include/wimlib.h
b/include/wimlib.h
index ffc9cdbf3d9ef31acee107fe6594d387bf93412f..649f52a3c884f3734423db2fc9e073362a52707e 100644
(file)
--- a/
include/wimlib.h
+++ b/
include/wimlib.h
@@
-725,6
+725,7
@@
enum wimlib_progress_msg {
* Currently, only the following types of errors will result in this
* progress message being sent:
*
* Currently, only the following types of errors will result in this
* progress message being sent:
*
+ * - Directory tree scan errors, e.g. from wimlib_add_image()
*/
WIMLIB_PROGRESS_MSG_HANDLE_ERROR = 31,
};
*/
WIMLIB_PROGRESS_MSG_HANDLE_ERROR = 31,
};
diff --git
a/include/wimlib/capture.h
b/include/wimlib/capture.h
index b30688a45cac78c6e85fe81d1622e7343f636aa6..b2938d510b6a59d622d8f6f8f0f7dba6cc44c3ef 100644
(file)
--- a/
include/wimlib/capture.h
+++ b/
include/wimlib/capture.h
@@
-4,6
+4,7
@@
#include "wimlib.h"
#include "wimlib/inode_table.h"
#include "wimlib/list.h"
#include "wimlib.h"
#include "wimlib/inode_table.h"
#include "wimlib/list.h"
+#include "wimlib/progress.h"
#include "wimlib/security.h"
#include "wimlib/textfile.h"
#include "wimlib/util.h"
#include "wimlib/security.h"
#include "wimlib/textfile.h"
#include "wimlib/util.h"
@@
-115,4
+116,11
@@
unix_build_dentry_tree(struct wim_dentry **root_ret,
#define WIMLIB_ADD_FLAG_ROOT 0x80000000
#define WIMLIB_ADD_FLAG_ROOT 0x80000000
+static inline int
+report_capture_error(struct add_image_params *params, int error_code,
+ const tchar *path)
+{
+ return report_error(params->progfunc, params->progctx, error_code, path);
+}
+
#endif /* _WIMLIB_CAPTURE_H */
#endif /* _WIMLIB_CAPTURE_H */
diff --git
a/src/ntfs-3g_capture.c
b/src/ntfs-3g_capture.c
index af6fa5423de2208b98d3b927683ea336dfde119a..6255f09a5ac6521efd002130224ca4776b4eba6e 100644
(file)
--- a/
src/ntfs-3g_capture.c
+++ b/
src/ntfs-3g_capture.c
@@
-704,10
+704,12
@@
out_progress:
else
ret = do_capture_progress(params, WIMLIB_SCAN_DENTRY_OK, inode);
out:
else
ret = do_capture_progress(params, WIMLIB_SCAN_DENTRY_OK, inode);
out:
- if (ret == 0)
- *root_ret = root;
- else
+ if (unlikely(ret)) {
free_dentry_tree(root, params->lookup_table);
free_dentry_tree(root, params->lookup_table);
+ root = NULL;
+ ret = report_capture_error(params, ret, path);
+ }
+ *root_ret = root;
return ret;
}
return ret;
}
diff --git
a/src/unix_capture.c
b/src/unix_capture.c
index 884c9fd4394972c4475842f1d5482d9a662b2ec9..66cb4be20265133a647f425d63b8e3f81723d91b 100644
(file)
--- a/
src/unix_capture.c
+++ b/
src/unix_capture.c
@@
-437,10
+437,12
@@
out_progress:
else
ret = do_capture_progress(params, WIMLIB_SCAN_DENTRY_EXCLUDED, NULL);
out:
else
ret = do_capture_progress(params, WIMLIB_SCAN_DENTRY_EXCLUDED, NULL);
out:
- if (likely(ret == 0))
- *tree_ret = tree;
- else
+ if (unlikely(ret)) {
free_dentry_tree(tree, params->lookup_table);
free_dentry_tree(tree, params->lookup_table);
+ tree = NULL;
+ ret = report_capture_error(params, ret, full_path);
+ }
+ *tree_ret = tree;
return ret;
}
return ret;
}
diff --git
a/src/win32_capture.c
b/src/win32_capture.c
index 7d6d45838178ac773bdd5a1ee0f68b3b4421f1fc..449e73e07714dd5a6d2724a8a289d40eac0fff1b 100644
(file)
--- a/
src/win32_capture.c
+++ b/
src/win32_capture.c
@@
-1383,10
+1383,12
@@
out_progress:
out:
if (likely(h != INVALID_HANDLE_VALUE))
(*func_NtClose)(h);
out:
if (likely(h != INVALID_HANDLE_VALUE))
(*func_NtClose)(h);
- if (likely(ret == 0))
- *root_ret = root;
- else
+ if (unlikely(ret)) {
free_dentry_tree(root, params->lookup_table);
free_dentry_tree(root, params->lookup_table);
+ root = NULL;
+ ret = report_capture_error(params, ret, full_path);
+ }
+ *root_ret = root;
return ret;
}
return ret;
}