summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;