aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-09 12:36:59 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-09 12:36:59 +0100
commit2dd56b2b0f1c518613dbb765e2d815aae5d6db7d (patch)
tree6786405b5cc249136f049b0c2a4f6bc34466232c
parentmake exit_if easier on the syntax (diff)
downloadmds-2dd56b2b0f1c518613dbb765e2d815aae5d6db7d.tar.gz
mds-2dd56b2b0f1c518613dbb765e2d815aae5d6db7d.tar.bz2
mds-2dd56b2b0f1c518613dbb765e2d815aae5d6db7d.tar.xz
make sure errno is not changed during fail_if
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/libmdsserver/macros.h2
1 files changed, 2 insertions, 0 deletions
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)