1162852Sdes/* $OpenBSD: fatal.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
292555Sdes/*
392555Sdes * Copyright (c) 2002 Markus Friedl.  All rights reserved.
492555Sdes *
592555Sdes * Redistribution and use in source and binary forms, with or without
692555Sdes * modification, are permitted provided that the following conditions
792555Sdes * are met:
892555Sdes * 1. Redistributions of source code must retain the above copyright
992555Sdes *    notice, this list of conditions and the following disclaimer.
1092555Sdes * 2. Redistributions in binary form must reproduce the above copyright
1192555Sdes *    notice, this list of conditions and the following disclaimer in the
1292555Sdes *    documentation and/or other materials provided with the distribution.
1392555Sdes *
1492555Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1592555Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1692555Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1792555Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1892555Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1992555Sdes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2092555Sdes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2192555Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2292555Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2392555Sdes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2492555Sdes */
2592555Sdes
2692555Sdes#include "includes.h"
2792555Sdes
28162852Sdes#include <sys/types.h>
29162852Sdes
30162852Sdes#include <stdarg.h>
31162852Sdes
3292555Sdes#include "log.h"
3392555Sdes
3492555Sdes/* Fatal messages.  This function never returns. */
3592555Sdes
3692555Sdesvoid
3792555Sdesfatal(const char *fmt,...)
3892555Sdes{
3992555Sdes	va_list args;
40162852Sdes
4192555Sdes	va_start(args, fmt);
4292555Sdes	do_log(SYSLOG_LEVEL_FATAL, fmt, args);
4392555Sdes	va_end(args);
44126274Sdes	cleanup_exit(255);
4592555Sdes}
46