diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-09 03:45:41 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-09 03:45:41 +0100 |
commit | 2daf9a84928af40650a28dedbd717b8d8b881ed1 (patch) | |
tree | d35c05470338c6262e1525985bdeaa9ee9743006 | |
parent | with a few exceptions, never return directly on failure, always goto fail by invoking fail_if (diff) | |
download | mds-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>
-rw-r--r-- | src/libmdsserver/macros.h | 12 |
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) /** |