From a724235b6127f9655708614d1e44f9b5c661a506 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 22 Feb 2016 14:07:57 -0500 Subject: make alpm_unlock and trans_interrupt async safe RET_ERR calls _alpm_log which includes calls that are not safe for use in asynchronous signal handlers (see signal(7)). Replace it in functions called from our signal handlers with a new macro RET_ERR_ASYNC_SAFE which is identical except that it lacks the call to _alpm_log. Signed-off-by: Andrew Gregory --- lib/libalpm/util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libalpm/util.h') diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 9817939f..94949867 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -71,6 +71,10 @@ void _alpm_alloc_fail(size_t size); (handle)->pm_errno = (err); \ return (ret); } while(0) +#define RET_ERR_ASYNC_SAFE(handle, err, ret) do { \ + (handle)->pm_errno = (err); \ + return (ret); } while(0) + #define DOUBLE_EQ(x, y) (fabs((x) - (y)) < DBL_EPSILON) #define CHECK_HANDLE(handle, action) do { if(!(handle)) { action; } (handle)->pm_errno = 0; } while(0) -- cgit v1.2.3-24-g4f1b