summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/queue.c
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-12-14 16:44:15 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-12-14 16:44:15 +0000
commit034a0252a19eeacb9c170b4e9e717523762a88ed (patch)
tree6946497f3035e5820fcaf2bcf9d23cc4b63b108d /usr.sbin/smtpd/queue.c
parent08715c4cca55339b6172439518c6befab992639b (diff)
Impose sessions limit on the delivery sessions (mta and mda).
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
-rw-r--r--usr.sbin/smtpd/queue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c
index d43164ac4c4..8d6a505efdf 100644
--- a/usr.sbin/smtpd/queue.c
+++ b/usr.sbin/smtpd/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.74 2009/12/13 22:02:55 jacekm Exp $ */
+/* $OpenBSD: queue.c,v 1.75 2009/12/14 16:44:14 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -585,6 +585,8 @@ queue(struct smtpd *env)
* increase relative to default.
*/
fdlimit(getdtablesize() * 2);
+ if ((env->sc_maxconn = availdesc() / 4) < 1)
+ fatalx("runner: fd starvation");
config_pipes(env, peers, nitems(peers));
config_peers(env, peers, nitems(peers));