From 2dd56b2b0f1c518613dbb765e2d815aae5d6db7d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Dec 2014 12:36:59 +0100 Subject: make sure errno is not changed during fail_if MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index 10ae2af..7921fb5 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -387,8 +387,10 @@ do \ if (__VA_ARGS__) \ { \ + int _fail_if_saved_errno = errno; \ if ((errno != EMSGSIZE) && (errno != ECONNRESET) && (errno != EINTR)) \ fprintf(stderr, "failure at %s:%i\n", __FILE__, __LINE__); \ + errno = _fail_if_saved_errno; \ goto fail; \ } \ while (0) -- cgit v1.2.3-70-g09d2