*
* (c) 1997--2009 Martin Mares <mj@ucw.cz>
* (c) 2008 Tomas Gavenciak <gavento@ucw.cz>
+ * (c) 2014 Tomas Valla <tom@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
static int default_log_handler(struct log_stream *ls UNUSED, struct log_msg *m)
{
// This is a completely bare version of the log-file module. Errors are ignored.
- write(2, m->m, m->m_len);
+ if (write(2, m->m, m->m_len) < 0)
+ {
+ }
return 0;
}
abort();
}
+void
+assert_failed_msg(const char *assertion, const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vmsg(L_DEBUG, fmt, args);
+ msg(L_FATAL, "Assertion `%s' failed at %s:%d", assertion, file, line);
+ abort();
+}
+
void
assert_failed_noinfo(void)
{