Don't copy util functions in client.c

This requires moving croak() to logging.c and avoiding use
of log functions in util.c.
This commit is contained in:
Miroslav Lichvar
2009-09-15 18:08:58 +02:00
parent 19f3a6bca8
commit 5a2b38378c
7 changed files with 28 additions and 62 deletions

View File

@@ -214,3 +214,19 @@ LOG_GoDaemon(void)
}
/* ================================================== */
/* Force a core dump and exit without doing abort() or assert(0).
These do funny things with the call stack in the core file that is
generated, which makes diagnosis difficult. */
int
croak(const char *file, int line, const char *msg)
{
int a;
LOG(LOGS_ERR, LOGF_Util, "Unexpected condition [%s] at %s:%d, core dumped",
msg, file, line);
a = * (int *) 0;
return a; /* Can't happen - this stops the optimiser optimising the
line above */
}
/* ================================================== */