aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-09 03:45:41 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-09 03:45:41 +0100
commit2daf9a84928af40650a28dedbd717b8d8b881ed1 (patch)
treed35c05470338c6262e1525985bdeaa9ee9743006
parentwith a few exceptions, never return directly on failure, always goto fail by invoking fail_if (diff)
downloadmds-2daf9a84928af40650a28dedbd717b8d8b881ed1.tar.gz
mds-2daf9a84928af40650a28dedbd717b8d8b881ed1.tar.bz2
mds-2daf9a84928af40650a28dedbd717b8d8b881ed1.tar.xz
do no print whence an error occurred if it is EMSGSIZE, ECONNRESET or EINTR, those are not real errors, just abnormalities
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libmdsserver/macros.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h
index fc47e0a..f82c01d 100644
--- a/src/libmdsserver/macros.h
+++ b/src/libmdsserver/macros.h
@@ -383,9 +383,15 @@
*
* @param ... The condition
*/
-#define fail_if(...) \
- if (__VA_ARGS__) \
- do { fprintf(stderr, "failure at %s:%i\n", __FILE__, __LINE__); goto fail; } while (0)
+#define fail_if(...) \
+ if (__VA_ARGS__) \
+ do \
+ { \
+ if ((errno != EMSGSIZE) && (errno != ECONNRESET) && (errno != EINTR)) \
+ fprintf(stderr, "failure at %s:%i\n", __FILE__, __LINE__); \
+ goto fail; \
+ } \
+ while (0)
/**