Module Name: src
Committed By: christos
Date: Thu Oct 3 18:12:44 UTC 2019
Modified Files:
src/lib/libutil: efun.c
Log Message:
provide a default error function instead of trying to cast exit(3).
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libutil/efun.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libutil/efun.c
diff -u src/lib/libutil/efun.c:1.10 src/lib/libutil/efun.c:1.11
--- src/lib/libutil/efun.c:1.10 Sat Jul 25 22:20:30 2015
+++ src/lib/libutil/efun.c Thu Oct 3 14:12:44 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: efun.c,v 1.10 2015/07/26 02:20:30 kamil Exp $ */
+/* $NetBSD: efun.c,v 1.11 2019/10/03 18:12:44 christos Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#ifdef __RCSID
-__RCSID("$NetBSD: efun.c,v 1.10 2015/07/26 02:20:30 kamil Exp $");
+__RCSID("$NetBSD: efun.c,v 1.11 2019/10/03 18:12:44 christos Exp $");
#endif
#include <err.h>
@@ -49,11 +49,17 @@ __RCSID("$NetBSD: efun.c,v 1.10 2015/07/
static void (*efunc)(int, const char *, ...) = err;
+static void
+eexit(int e, const char *fmt __unused, ...)
+{
+ exit(e);
+}
+
void (*
esetfunc(void (*ef)(int, const char *, ...)))(int, const char *, ...)
{
void (*of)(int, const char *, ...) = efunc;
- efunc = ef == NULL ? (void (*)(int, const char *, ...))exit : ef;
+ efunc = ef == NULL ? eexit : ef;
return of;
}