From 11707e4be5b8cef1caf6ee2604c41368056afc81 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 7 Sep 2004 16:54:14 +0000 Subject: Don't quit when can't create thread. --- src/clamsmtpd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3