chiark / gitweb /
log: protect errno when we use assert_return()
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Dec 2013 14:58:49 +0000 (15:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Dec 2013 14:59:13 +0000 (15:59 +0100)
src/shared/log.c

index c654b862284a70449e96384242fccbbd43c564e6..2404de85e32bb849c4b6a55e7fc288043d2f1e6f 100644 (file)
@@ -713,6 +713,7 @@ _noreturn_ void log_assert_failed_unreachable(const char *text, const char *file
 }
 
 void log_assert_failed_return(const char *text, const char *file, int line, const char *func) {
 }
 
 void log_assert_failed_return(const char *text, const char *file, int line, const char *func) {
+        PROTECT_ERRNO;
         log_assert(LOG_DEBUG, text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Ignoring.");
 }
 
         log_assert(LOG_DEBUG, text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Ignoring.");
 }