X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/28ec221002d755d33c41fa4b5d9673eee0abef9d..a640546144e14bc303c3ca0de019b40818ccc319:/sbr/error.c?ds=inline diff --git a/sbr/error.c b/sbr/error.c index 96c89f58..fc5c6afa 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -5,15 +5,17 @@ * complete copyright information. */ -#include +#include "h/mh.h" +#include "error.h" #include #include - +#include "h/done.h" /* inform calls advertise() with no what and no tail. * Thus the simple "[invo_name: ]fmt\n" results. */ -void inform(char *fmt, ...) +void +inform(char *fmt, ...) { va_list ap; @@ -58,6 +60,21 @@ adios (const char *what, const char *fmt, ...) } +/* die is the same as adios(), but without the what as that's commonly + * NULL. */ +void NORETURN +die(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + advertise(NULL, NULL, fmt, ap); + va_end(ap); + done(1); + abort(); +} + + /* admonish calls advertise() with a tail indicating the program * continues. * Thus "[invo_name: ]fmt[[ what]: errno], continuing...\n" results. */