summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2008-11-24 22:30:20 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2008-11-24 22:30:20 +0000
commitbdb4757cfeae6b165f20e03c3121908fe9ac431f (patch)
tree3ac1f01a7e068a0309ecd6434926459eb67f3cb4 /usr.sbin/smtpd
parent42ac9405ffa860c511d84715345b87d3430a4766 (diff)
- not really a bug since we don't use other descriptor flags, but in
smtp_setup_events() and mta_connect(), our fcntl() use clears flags. use session_socket_blockmode() instead, it makes more sense anyway. From Jacek Masiulaniec <jacekm@dobremiasto.net>
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/mta.c6
-rw-r--r--usr.sbin/smtpd/smtp.c5
2 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index b77a367fc7c..382a356bf3f 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.5 2008/11/11 02:14:58 tedu Exp $ */
+/* $OpenBSD: mta.c,v 1.6 2008/11/24 22:30:19 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -355,9 +355,7 @@ mta_connect(struct batch *batchp)
goto bad;
}
- if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) {
- goto bad;
- }
+ session_socket_blockmode(s, BM_NONBLOCK);
if (batchp->ss[batchp->ss_off].ss_family == PF_INET) {
ssin = *(struct sockaddr_in *)&batchp->ss[batchp->ss_off];
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c
index dc1aaa199fc..7e456a84508 100644
--- a/usr.sbin/smtpd/smtp.c
+++ b/usr.sbin/smtpd/smtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp.c,v 1.6 2008/11/17 21:56:18 chl Exp $ */
+/* $OpenBSD: smtp.c,v 1.7 2008/11/24 22:30:19 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -506,8 +506,7 @@ smtp_setup_events(struct smtpd *env)
log_debug("smtp_setup_events: configuring listener: %p%s.",
l, (l->flags & F_SSL)?" (with ssl)":"");
- if (fcntl(l->fd, F_SETFL, O_NONBLOCK) == -1)
- fatal("fcntl");
+ session_socket_blockmode(l->fd, BM_NONBLOCK);
if (listen(l->fd, l->backlog) == -1)
fatal("listen");
l->env = env;