]> diplodocus.org Git - nmh/blobdiff - sbr/error.c
Moved OpenBSD back to "routinely built and tested" category.
[nmh] / sbr / error.c
index 96c89f5812ce92b003803cb835ea05f14d354c61..fc5c6afa1c609693b6a0ffdeddc9978547759159 100644 (file)
@@ -5,15 +5,17 @@
  * complete copyright information.
  */
 
  * complete copyright information.
  */
 
-#include <h/mh.h>
+#include "h/mh.h"
+#include "error.h"
 
 #include <sys/types.h>
 #include <sys/uio.h>
 
 #include <sys/types.h>
 #include <sys/uio.h>
-
+#include "h/done.h"
 
 /* inform calls advertise() with no what and no tail.
  * Thus the simple "[invo_name: ]fmt\n" results. */
 
 /* 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;
 
 {
     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. */
 /* admonish calls advertise() with a tail indicating the program
  * continues.
  * Thus "[invo_name: ]fmt[[ what]: errno], continuing...\n" results. */