opendoas

my fork of doas with custom prompt
git clone git://git.kocotian.pl/opendoas.git
Log | Files | Refs | README | LICENSE

commit 5dc1cdecb149196c944c3a0983051eeae6c2b3a0
parent 1fae30ee0ec3b4c7431c291ca8f63abbf67bff89
Author: Duncan Overbruck <mail@duncano.de>
Date:   Fri,  6 Dec 2019 02:43:57 +0100

libopenbsd: define __dead as noreturn

Diffstat:
Mincludes.h | 8--------
Mlibopenbsd/errc.c | 2+-
Mlibopenbsd/openbsd.h | 12++++++++++--
Mlibopenbsd/verrc.c | 2+-
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/includes.h b/includes.h @@ -1,14 +1,6 @@ #ifndef INCLUDES_H #define INCLUDES_H -#ifndef __UNUSED -# define __UNUSED __attribute__ ((unused)) -#endif - -#ifndef __dead -# define __dead -#endif - #ifndef _PATH_TTY # define _PATH_TTY "/dev/tty" #endif diff --git a/libopenbsd/errc.c b/libopenbsd/errc.c @@ -33,7 +33,7 @@ #include <err.h> #include <stdarg.h> -__dead void +void __dead errc(int eval, int code, const char *fmt, ...) { va_list ap; diff --git a/libopenbsd/openbsd.h b/libopenbsd/openbsd.h @@ -4,6 +4,14 @@ #include <stdarg.h> #include <sys/types.h> +#ifndef __UNUSED +# define __UNUSED __attribute__ ((unused)) +#endif + +#ifndef __dead +# define __dead __attribute__ ((noreturn)) +#endif + /* API definitions lifted from OpenBSD src/include */ /* pwd.h */ @@ -45,10 +53,10 @@ void closefrom(int); /* err.h */ #ifndef HAVE_VERRC -void verrc(int eval, int code, const char *fmt, va_list ap); +void __dead verrc(int eval, int code, const char *fmt, va_list ap); #endif /* !HAVE_VERRC */ #ifndef HAVE_ERRC -void errc(int eval, int code, const char *fmt, ...); +__dead void errc(int eval, int code, const char *fmt, ...); #endif /* !HAVE_ERRC */ #ifndef HAVE_SETPROGNAME diff --git a/libopenbsd/verrc.c b/libopenbsd/verrc.c @@ -36,7 +36,7 @@ #include <string.h> #include <stdarg.h> -__dead void +void __dead verrc(int eval, int code, const char *fmt, va_list ap) { (void)fprintf(stderr, "%s: ", getprogname());