log: Eliminate potential out-of-control recursion
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Jun 2012 23:36:15 +0000 (00:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 19:02:20 +0000 (20:02 +0100)
commitba72e2bf5e1a1cedc74f7de35e29cce7a0f4fca1
treeb32a6f1441a9db1331108062c91a936b715dbe5e
parent68438849fa74b4dc3c3354b990bcd05e8fb78861
log: Eliminate potential out-of-control recursion

vMessage looks for the system log instance.  If there is one, it uses
it; otherwise it just uses stderr or stdout.

The system log instance consists, eventually, of syslog_vlog or
logfile_vlog.  Both of these functions have a fallback: if they are
properly set up they do their thing; otherwise they call vMessage.
This is wrong because in this situation they have probably been called
by vMessage so it doesn't help.

At first sight this ought to produce unbounded recursion but for
complicated reasons another bug prevents this.  Instead, messages can
just vanish.

Break out the fallback mode of [v]Message into [v]MessageFallback so
that syslog_vlog and logfile_vlog can use it directly.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
log.c