From 66f08986d02cdf495459748731044f9842edb855 Mon Sep 17 00:00:00 2001 From: Frank Benkstein Date: Wed, 3 Oct 2007 13:53:14 +0200 Subject: [PATCH] src/util.h: GUARD_ERRNO macro --- src/util.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util.h b/src/util.h index 50cd03f..eebd946 100644 --- a/src/util.h +++ b/src/util.h @@ -34,3 +34,8 @@ void *ensure_realloc(void *, size_t); void *ensure_not_null(void *, const char *); #define STRERROR (errno ? strerror(errno) : "Unknown error") + +#define GUARD_ERRNO(expr) \ + do { \ + int __errsv = errno; expr; errno = __errsv; \ + } while (0) -- 2.11.4.GIT