From 05ad06600b712a29bc99a65ae89f38d4d8f30371 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 13 Apr 2019 22:00:04 +0200 Subject: Add liberror_start and liberror_end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- start.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 start.c (limited to 'start.c') diff --git a/start.c b/start.c new file mode 100644 index 0000000..788011f --- /dev/null +++ b/start.c @@ -0,0 +1,16 @@ +/* See LICENSE file for copyright and license details. */ +#include "internal.h" + + +void +liberror_start(struct liberror_state *state) +{ + state->backtrace = liberror_saved_backtrace; + liberror_saved_backtrace = NULL; + state->have_error = liberror_have_error_; + liberror_have_error_ = 0; + state->errnum = errno; + errno = 0; + memcpy(&state->error, &liberror_error_, sizeof(liberror_error_)); + memset(&liberror_error_, 0, sizeof(liberror_error_)); +} -- cgit v1.2.3-70-g09d2