openssh-portable/regress/misc/sk-dummy/fatal.c

28 lines
494 B
C
Raw Normal View History

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