From 4aa67b7a74bb11df4cba5e49f1b089a7da6b5fc4 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 26 Nov 2015 07:42:11 +0000 Subject: No point in trying to go on when elementary database operations like preparing queries or binding variables fail; that won't yield useful results anyway but may generate huge pointless error messages. Issue reported by deraadt@. --- compat_err.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'compat_err.c') diff --git a/compat_err.c b/compat_err.c index fd6e11f4..d8b09cb2 100644 --- a/compat_err.c +++ b/compat_err.c @@ -6,7 +6,7 @@ int dummy; #else -/* $Id: compat_err.c,v 1.3 2015/11/07 14:22:29 schwarze Exp $ */ +/* $Id: compat_err.c,v 1.4 2015/11/26 07:42:11 schwarze Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -76,6 +76,18 @@ err(int eval, const char *fmt, ...) exit(eval); } +void +errx(int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwarnxi(fmt, ap); + va_end(ap); + fputc('\n', stderr); + exit(eval); +} + void warn(const char *fmt, ...) { -- cgit v1.2.3-56-ge451