aboutsummaryrefslogtreecommitdiffstats
path: root/set_error.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-04-13 00:46:50 +0200
committerMattias Andrée <maandree@kth.se>2019-04-13 00:46:50 +0200
commit5a50dba2c0832c58593e6aa88dd2144f64f0c544 (patch)
treed0467a2b3a5b05143e578899341946e8d28e1a91 /set_error.c
parentFix makefile (diff)
downloadliberror-5a50dba2c0832c58593e6aa88dd2144f64f0c544.tar.gz
liberror-5a50dba2c0832c58593e6aa88dd2144f64f0c544.tar.bz2
liberror-5a50dba2c0832c58593e6aa88dd2144f64f0c544.tar.xz
Enable prefetching backtace
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--set_error.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/set_error.c b/set_error.c
index 38617c7..a44aac6 100644
--- a/set_error.c
+++ b/set_error.c
@@ -33,7 +33,12 @@ liberror_set_error(const char description[256], const char source[64], const cha
stpcpy(error->source, source);
stpcpy(error->code_group, code_group);
error->code = code;
- liberror_save_backtrace(error);
+ if (liberror_saved_backtrace) {
+ error->backtrace = liberror_saved_backtrace;
+ liberror_saved_backtrace = NULL;
+ } else {
+ liberror_save_backtrace(error);
+ }
error->cause = cause;
error->failed_to_allocate_cause = have_cause && !cause;
}