X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Flog.c;h=31252c9ee2b0f1f083d6eb2bfb29d3b06c9a8e17;hb=31316f76dd68a03b803f51931d6e1fff2c60c5d1;hp=1195a0a548a31e2f473a5256b06be2a2d7f41527;hpb=8f413de06b0f1bc71abe3b63b82b41e3b0486705;p=libucw.git diff --git a/ucw/log.c b/ucw/log.c index 1195a0a5..31252c9e 100644 --- a/ucw/log.c +++ b/ucw/log.c @@ -45,8 +45,10 @@ struct log_stream log_stream_default = { .types = ~0U, .msgfmt = LSFMT_DEFAULT, // an empty clist - .substreams.head.next = (cnode *) &log_stream_default.substreams.head, - .substreams.head.prev = (cnode *) &log_stream_default.substreams.head, + .substreams.head = { + .next = (cnode *) &log_stream_default.substreams.head, + .prev = (cnode *) &log_stream_default.substreams.head, + }, }; /*** Registry of streams and their identifiers ***/ @@ -340,18 +342,22 @@ do_die(void) } void -die(const char *fmt, ...) +vdie(const char *fmt, va_list args) { - va_list args; - - va_start(args, fmt); vmsg(L_FATAL, fmt, args); - va_end(args); if (log_die_hook) log_die_hook(); do_die(); } +void +die(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vdie(fmt, args); +} + void assert_failed(const char *assertion, const char *file, int line) {