From 0c5ab80654c42fa04d285bb6ca9e45c1f21027d2 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Thu, 15 Oct 2015 13:13:44 +0200 Subject: [PATCH] fixed err() implementation, exit(eval) according to spec --- libpcp/platform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libpcp/platform.c b/libpcp/platform.c index 740ef3b..e4aa381 100644 --- a/libpcp/platform.c +++ b/libpcp/platform.c @@ -32,6 +32,12 @@ void err(int eval, const char *fmt, ...) { } fprintf(stderr, ": %s\n", strerror(errno)); va_end(ap); + + /* from the FreeBSD err() manpage: + The err(), verr(), errc(), verrc(), errx(), and verrx() functions do not + return, but exit with the value of the argument eval. + */ + exit(eval); } #endif