Avoids the noise of the `NULL' first parameter that's used in over 70%
of adios() calls. Removes the possibility of it being omitted and `fmt'
being used instead. `die' is already in use in nmh's shell scripts.
Had to rename post.c's existing die() to avoid it clashing.
void add_profile_entry (const char *, const char *);
void inform(char *fmt, ...) CHECK_PRINTF(1, 2);
void adios (const char *, const char *, ...) CHECK_PRINTF(2, 3) NORETURN;
void add_profile_entry (const char *, const char *);
void inform(char *fmt, ...) CHECK_PRINTF(1, 2);
void adios (const char *, const char *, ...) CHECK_PRINTF(2, 3) NORETURN;
+void die(const char *, ...) CHECK_PRINTF(1, 2) NORETURN;
void admonish (char *, char *, ...) CHECK_PRINTF(2, 3);
void advertise (const char *, char *, const char *, va_list) CHECK_PRINTF(3, 0);
void advise (const char *, const char *, ...) CHECK_PRINTF(2, 3);
void admonish (char *, char *, ...) CHECK_PRINTF(2, 3);
void advertise (const char *, char *, const char *, va_list) CHECK_PRINTF(3, 0);
void advise (const char *, const char *, ...) CHECK_PRINTF(2, 3);
+/* 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. */
static void sigoff (void);
static void p_refile (char *);
static void fcc (char *, char *);
static void sigoff (void);
static void p_refile (char *);
static void fcc (char *, char *);
-static void die (char *, char *, ...) CHECK_PRINTF(2, 3);
+static void fatal (char *, char *, ...) CHECK_PRINTF(2, 3);
static void post (char *, int, int, int, char *, int, char *);
static void do_text (char *file, int fd);
static void do_an_address (struct mailname *, int);
static void post (char *, int, int, int, char *, int, char *);
static void do_text (char *file, int fd);
static void do_an_address (struct mailname *, int);
chkadr (void)
{
if (badadr && unkadr)
chkadr (void)
{
if (badadr && unkadr)
- die (NULL, "%d address%s unparsable, %d addressee%s undeliverable",
+ fatal (NULL, "%d address%s unparsable, %d addressee%s undeliverable",
badadr, PLURALS(badadr), unkadr, PLURALS(badadr));
if (badadr)
badadr, PLURALS(badadr), unkadr, PLURALS(badadr));
if (badadr)
- die (NULL, "%d address%s unparsable", badadr, PLURALS(badadr));
+ fatal (NULL, "%d address%s unparsable", badadr, PLURALS(badadr));
- die (NULL, "%d addressee%s undeliverable", unkadr, PLURALS(unkadr));
+ fatal (NULL, "%d addressee%s undeliverable", unkadr, PLURALS(unkadr));
chkadr ();
if (rp_isbad (retval = sm_waend ()))
chkadr ();
if (rp_isbad (retval = sm_waend ()))
- die (NULL, "problem ending addresses; %s", rp_string (retval));
+ fatal (NULL, "problem ending addresses; %s", rp_string (retval));
int eightbit = 0;
if (fd == NOTOK) {
int eightbit = 0;
if (fd == NOTOK) {
- die (file, "unable to re-open");
+ fatal (file, "unable to re-open");
}
if (msgflags & MMIM && cte != UNKNOWN) {
}
if (msgflags & MMIM && cte != UNKNOWN) {
} else {
if (scan_input (fd, &eightbit) == NOTOK) {
close (fd);
} else {
if (scan_input (fd, &eightbit) == NOTOK) {
close (fd);
- die (file, "problem reading from");
+ fatal (file, "problem reading from");
oauth_flag ? auth_svc : NULL, tlsflag))
|| rp_isbad (retval = sm_winit (envelope, eai, eightbit))) {
close (fd);
oauth_flag ? auth_svc : NULL, tlsflag))
|| rp_isbad (retval = sm_winit (envelope, eai, eightbit))) {
close (fd);
- die (NULL, "problem initializing server; %s", rp_string (retval));
+ fatal (NULL, "problem initializing server; %s", rp_string (retval));
}
do_addresses (bccque, talk && verbose);
}
do_addresses (bccque, talk && verbose);
verbose, snoop, sasl, saslmech, user,
oauth_flag ? auth_svc : NULL, tlsflag))
|| rp_isbad (retval = sm_winit (envelope, eai, eightbit))) {
verbose, snoop, sasl, saslmech, user,
oauth_flag ? auth_svc : NULL, tlsflag))
|| rp_isbad (retval = sm_winit (envelope, eai, eightbit))) {
- die (NULL, "problem initializing server; %s", rp_string (retval));
+ fatal (NULL, "problem initializing server; %s", rp_string (retval));
default:
if (!talk)
fprintf (stderr, " %s: ", addr);
default:
if (!talk)
fprintf (stderr, " %s: ", addr);
- die (NULL, "unexpected response; %s", rp_string (retval));
+ fatal (NULL, "unexpected response; %s", rp_string (retval));
while ((state = read (fd, buf, sizeof(buf))) > 0) {
if (rp_isbad (retval = sm_wtxt (buf, state)))
while ((state = read (fd, buf, sizeof(buf))) > 0) {
if (rp_isbad (retval = sm_wtxt (buf, state)))
- die (NULL, "problem writing text; %s\n", rp_string (retval));
+ fatal (NULL, "problem writing text; %s\n", rp_string (retval));
- die (file, "problem reading from");
+ fatal (file, "problem reading from");
switch (retval = sm_wtend ()) {
case RP_OK:
switch (retval = sm_wtend ()) {
case RP_OK:
case RP_NO:
case RP_NDEL:
case RP_NO:
case RP_NDEL:
- die (NULL, "posting failed; %s", rp_string (retval));
+ fatal (NULL, "posting failed; %s", rp_string (retval));
- die (NULL, "unexpected response; %s", rp_string (retval));
+ fatal (NULL, "unexpected response; %s", rp_string (retval));
-die (char *what, char *fmt, ...)
+fatal (char *what, char *fmt, ...)