From a57d3236793aa204f0a21f93435d642108438bca Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Aug 2016 17:33:48 +0200 Subject: Fix signal handlers: restore errno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/coopgammad.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coopgammad.c b/src/coopgammad.c index ddb98ad..dd0c9c2 100644 --- a/src/coopgammad.c +++ b/src/coopgammad.c @@ -117,8 +117,10 @@ char* restrict socketpath = NULL; */ static void sig_reexec(int signo) { + int saved_errno = errno; reexec = 1; signal(signo, sig_reexec); + errno = saved_errno; } @@ -144,8 +146,10 @@ static void sig_terminate(int signo) */ static void sig_connection(int signo) { + int saved_errno = errno; connection = signo - SIGRTMIN + 1; signal(signo, sig_connection); + errno = saved_errno; } -- cgit v1.2.3-70-g09d2