summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clamsmtpd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c
index 85b9a14..4c08919 100644
--- a/src/clamsmtpd.c
+++ b/src/clamsmtpd.c
@@ -502,9 +502,17 @@ static void connection_loop(int sock)
(void*)(threads + i));
if(r != 0)
{
+ threads[i].fd = -1;
+ threads[i].tid = 0;
+
errno = r;
- message(NULL, LOG_ERR, "couldn't create thread");
- ((clstate_t*)g_state)->quit = 1;
+ message(NULL, LOG_ERR, "couldn't create thread for connection");
+ write(fd, SMTP_STARTFAILED, KL(SMTP_STARTFAILED));
+
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
+ fd = -1;
+
break;
}