summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtpd.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-05-30 23:28:53 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-05-30 23:28:53 +0000
commitc239cd64597500749d5db24f73f2cf50ae549102 (patch)
tree3dc231e5d7691fe10e60f8c9161f7b8ce19077d7 /usr.sbin/smtpd/smtpd.c
parentc783e88aadde94bbe521013f3dbff71df8fff4f3 (diff)
fatal on setsockopt() failures
Diffstat (limited to 'usr.sbin/smtpd/smtpd.c')
-rw-r--r--usr.sbin/smtpd/smtpd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index f7600a3d290..4cdfa20bc83 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.67 2009/05/25 14:00:36 jacekm Exp $ */
+/* $OpenBSD: smtpd.c,v 1.68 2009/05/30 23:28:52 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -149,7 +149,8 @@ parent_send_config_listeners(struct smtpd *env)
if ((l->fd = socket(l->ss.ss_family, SOCK_STREAM, 0)) == -1)
fatal("socket");
opt = 1;
- setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+ if (setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0)
+ fatal("setsockopt");
if (bind(l->fd, (struct sockaddr *)&l->ss, l->ss.ss_len) == -1)
fatal("bind");
imsg_compose(env->sc_ibufs[PROC_SMTP], IMSG_CONF_LISTENER,