diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/aliases.c | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/dns.c | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/lka.c | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/mda.c | 18 | ||||
-rw-r--r-- | usr.sbin/smtpd/mta.c | 17 | ||||
-rw-r--r-- | usr.sbin/smtpd/runner.c | 9 |
6 files changed, 30 insertions, 35 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c index e5a783a8767..5c13c30764e 100644 --- a/usr.sbin/smtpd/aliases.c +++ b/usr.sbin/smtpd/aliases.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aliases.c,v 1.8 2008/12/05 17:31:54 gilles Exp $ */ +/* $OpenBSD: aliases.c,v 1.9 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -287,7 +287,7 @@ aliases_expand_include(struct aliaseslist *aliases, char *filename) fp = fopen(filename, "r"); if (fp == NULL) { - warnx("failed to open include file \"%s\".", filename); + log_warnx("failed to open include file \"%s\".", filename); return 0; } @@ -297,11 +297,11 @@ aliases_expand_include(struct aliaseslist *aliases, char *filename) continue; } if (! alias_parse(&alias, line)) { - warnx("could not parse include entry \"%s\".", line); + log_warnx("could not parse include entry \"%s\".", line); } if (alias.type == ALIAS_INCLUDE) { - warnx("nested inclusion is not supported."); + log_warnx("nested inclusion is not supported."); } else { aliasp = calloc(1, sizeof(struct alias)); diff --git a/usr.sbin/smtpd/dns.c b/usr.sbin/smtpd/dns.c index 55087e2a404..9a57e6948d7 100644 --- a/usr.sbin/smtpd/dns.c +++ b/usr.sbin/smtpd/dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dns.c,v 1.5 2008/12/01 22:54:08 gilles Exp $ */ +/* $OpenBSD: dns.c,v 1.6 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -26,7 +26,6 @@ #include <arpa/inet.h> #include <arpa/nameser.h> -#include <err.h> #include <event.h> #include <netdb.h> #include <resolv.h> @@ -171,9 +170,8 @@ getmxbyname(char *name, char ***result) chunklen += ((mxnb + 1) * sizeof(char *)); *result = calloc(1, chunklen); - if (*result == NULL) { - err(1, "calloc"); - } + if (*result == NULL) + fatal("getmxbyname: calloc"); ptr = (u_int8_t *)*result + (mxnb + 1) * sizeof(char *); for (i = 0; i < mxnb; ++i) { diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 0f74cfe1954..a1b746c4130 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.5 2008/12/05 02:51:32 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.6 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -29,7 +29,6 @@ #include <ctype.h> #include <db.h> -#include <err.h> #include <event.h> #include <fcntl.h> #include <pwd.h> @@ -529,7 +528,7 @@ lka_dispatch_runner(int sig, short event, void *p) batchp = imsg.data; if (! IS_RELAY(batchp->rule.r_action)) - err(1, "lka_dispatch_queue: inconsistent internal state"); + fatalx("lka_dispatch_queue: inconsistent internal state"); if (batchp->rule.r_action == A_RELAY) { log_debug("attempting to resolve %s", batchp->hostname); diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c index 2532eb649b8..eb1ce00313a 100644 --- a/usr.sbin/smtpd/mda.c +++ b/usr.sbin/smtpd/mda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mda.c,v 1.3 2008/12/05 02:51:32 gilles Exp $ */ +/* $OpenBSD: mda.c,v 1.4 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -89,7 +89,7 @@ mda_dispatch_parent(int sig, short event, void *p) for (;;) { if ((n = imsg_get(ibuf, &imsg)) == -1) - fatal("parent_dispatch_mda: imsg_read error"); + fatal("mda_dispatch_parent: imsg_read error"); if (n == 0) break; @@ -105,11 +105,11 @@ mda_dispatch_parent(int sig, short event, void *p) batchp = batch_by_id(env, batchp->id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_parent: internal inconsistency."); messagep = message_by_id(env, batchp, messagep->id); if (messagep == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_parent: internal inconsistency."); messagep->status = status; messagep->mboxfd = imsg_get_fd(ibuf, &imsg); @@ -137,11 +137,11 @@ mda_dispatch_parent(int sig, short event, void *p) batchp = batch_by_id(env, batchp->id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_parent: internal inconsistency."); messagep = message_by_id(env, batchp, messagep->id); if (messagep == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_parent: internal inconsistency."); messagep->status = status; messagep->messagefd = imsg_get_fd(ibuf, &imsg); @@ -173,7 +173,7 @@ mda_dispatch_parent(int sig, short event, void *p) break; } default: - log_debug("parent_dispatch_mda: unexpected imsg %d", + log_debug("mda_dispatch_parent: unexpected imsg %d", imsg.hdr.type); break; } @@ -290,7 +290,7 @@ mda_dispatch_runner(int sig, short event, void *p) *messagep = *(struct message *)imsg.data; batchp = batch_by_id(env, messagep->batch_id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_runner: internal inconsistency."); TAILQ_INSERT_TAIL(&batchp->messages, messagep, entry); break; @@ -304,7 +304,7 @@ mda_dispatch_runner(int sig, short event, void *p) lookup = *(struct batch *)imsg.data; batchp = batch_by_id(env, lookup.id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mda_dispatch_runner: internal inconsistency."); lookup = *batchp; TAILQ_FOREACH(messagep, &batchp->messages, entry) { diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 7e2f425b082..8998688914b 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.8 2008/12/05 02:51:32 gilles Exp $ */ +/* $OpenBSD: mta.c,v 1.9 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -26,7 +26,6 @@ #include <netinet/in.h> #include <arpa/inet.h> -#include <err.h> #include <errno.h> #include <event.h> #include <fcntl.h> @@ -157,14 +156,14 @@ mta_dispatch_queue(int sig, short event, void *p) if ((fd = imsg_get_fd(ibuf, &imsg)) == -1) { /* NEEDS_FIX - unsure yet how it must be handled */ - errx(1, "imsg_get_fd"); + fatalx("mta_dispatch_queue: imsg_get_fd"); } batchp = (struct batch *)imsg.data; batchp = batch_by_id(env, batchp->id); if ((batchp->messagefp = fdopen(fd, "r")) == NULL) - err(1, "fdopen"); + fatal("mta_dispatch_queue: fdopen"); evbuffer_add_printf(batchp->bev->output, "DATA\r\n"); @@ -222,7 +221,7 @@ mta_dispatch_runner(int sig, short event, void *p) batchp = calloc(1, sizeof (struct batch)); if (batchp == NULL) - err(1, "calloc"); + fatal("mta_dispatch_runner: calloc"); *batchp = *(struct batch *)imsg.data; batchp->mx_off = 0; @@ -240,13 +239,13 @@ mta_dispatch_runner(int sig, short event, void *p) messagep = calloc(1, sizeof (struct message)); if (messagep == NULL) - fatal("calloc"); + fatal("mta_dispatch_runner: calloc"); *messagep = *(struct message *)imsg.data; batchp = batch_by_id(env, messagep->batch_id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mta_dispatch_runner: internal inconsistency."); TAILQ_INSERT_TAIL(&batchp->messages, messagep, entry); @@ -258,7 +257,7 @@ mta_dispatch_runner(int sig, short event, void *p) batchp = (struct batch *)imsg.data; batchp = batch_by_id(env, batchp->id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("mta_dispatch_runner: internal inconsistency."); batchp->flags |= F_BATCH_COMPLETE; @@ -770,7 +769,7 @@ mta_write_handler(struct bufferevent *bev, void *arg) buf[len - 1] = '\0'; else { if ((lbuf = malloc(len + 1)) == NULL) - err(1, "malloc"); + fatal("mta_write_handler: malloc"); memcpy(lbuf, buf, len); lbuf[len] = '\0'; buf = lbuf; diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 447e6e14e93..a6e901282a7 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.1 2008/12/05 02:51:32 gilles Exp $ */ +/* $OpenBSD: runner.c,v 1.2 2008/12/05 19:09:59 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -29,7 +29,6 @@ #include <arpa/inet.h> #include <dirent.h> -#include <err.h> #include <errno.h> #include <event.h> #include <fcntl.h> @@ -613,7 +612,7 @@ runner_process_runqueue(struct smtpd *env) messagep = calloc(1, sizeof (struct message)); if (messagep == NULL) - err(1, "calloc"); + fatal("runner_process_runqueue: calloc"); *messagep = message; batchp = batch_lookup(env, messagep); @@ -802,12 +801,12 @@ batch_record(struct smtpd *env, struct message *messagep) if (messagep->batch_id != 0) { batchp = batch_by_id(env, messagep->batch_id); if (batchp == NULL) - errx(1, "%s: internal inconsistency.", __func__); + fatalx("batch_record: internal inconsistency."); } if (batchp == NULL) { batchp = calloc(1, sizeof(struct batch)); if (batchp == NULL) - err(1, "%s: calloc", __func__); + fatal("batch_record: calloc"); batchp->id = queue_generate_id(); batchp->creation = messagep->creation; |