2019-11-29 01:52:23 +01:00
|
|
|
/* public domain */
|
|
|
|
|
2020-10-17 02:42:26 +02:00
|
|
|
#include "includes.h"
|
|
|
|
|
2019-11-29 01:52:23 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2020-10-17 13:55:24 +02:00
|
|
|
#include "log.h"
|
|
|
|
|
2019-11-29 01:52:23 +01:00
|
|
|
void
|
2020-10-17 13:47:52 +02:00
|
|
|
sshfatal(const char *file, const char *func, int line, int showfunc,
|
2020-10-18 13:32:01 +02:00
|
|
|
LogLevel level, const char *suffix, const char *fmt, ...)
|
2019-11-29 01:52:23 +01:00
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
|
2020-10-17 13:47:52 +02:00
|
|
|
if (showfunc)
|
|
|
|
fprintf(stderr, "%s: ", func);
|
2019-11-29 01:52:23 +01:00
|
|
|
va_start(ap, fmt);
|
|
|
|
vfprintf(stderr, fmt, ap);
|
|
|
|
va_end(ap);
|
2020-10-18 13:32:01 +02:00
|
|
|
if (suffix != NULL)
|
|
|
|
fprintf(stderr, ": %s", suffix);
|
2019-11-29 01:52:23 +01:00
|
|
|
fputc('\n', stderr);
|
|
|
|
_exit(1);
|
|
|
|
}
|