summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2010-05-31 22:25:27 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2010-05-31 22:25:27 +0000
commit591293015f3e6c1412e51ad20d7817e6987a652f (patch)
treed0afb8303e846ba9564a080f1a3e739f93c03888 /usr.sbin/smtpd
parent201c7bfc4fe7bf196f8560b71bcddbbc96a18c5b (diff)
imsg_compose_event() return value was never checked. Make it fatal() if needed.
ok jacekm@ gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/smtpd.c12
-rw-r--r--usr.sbin/smtpd/smtpd.h4
2 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index 8a15293cafc..b0f6a2ec08b 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.107 2010/05/27 15:36:04 gilles Exp $ */
+/* $OpenBSD: smtpd.c,v 1.108 2010/05/31 22:25:26 chl Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -777,16 +777,14 @@ imsg_event_add(struct imsgev *iev)
event_add(&iev->ev, NULL);
}
-int
+void
imsg_compose_event(struct imsgev *iev, u_int16_t type, u_int32_t peerid,
pid_t pid, int fd, void *data, u_int16_t datalen)
{
- int ret;
+ if (imsg_compose(&iev->ibuf, type, peerid, pid, fd, data, datalen) == -1)
+ fatal("imsg_compose_event");
- if ((ret = imsg_compose(&iev->ibuf, type, peerid,
- pid, fd, data, datalen)) != -1)
- imsg_event_add(iev);
- return (ret);
+ imsg_event_add(iev);
}
void
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index 2332081ccc1..6593a90cc9e 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.185 2010/05/27 15:36:04 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.186 2010/05/31 22:25:26 chl Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -894,7 +894,7 @@ int forwards_get(int, struct expandtree *);
int child_cmp(struct child *, struct child *);
SPLAY_PROTOTYPE(childtree, child, entry, child_cmp);
void imsg_event_add(struct imsgev *);
-int imsg_compose_event(struct imsgev *, u_int16_t, u_int32_t, pid_t,
+void imsg_compose_event(struct imsgev *, u_int16_t, u_int32_t, pid_t,
int, void *, u_int16_t);
void imsg_dispatch(int, short, void *);