From e05a209c83cf1e665a6639c05eff308178d2d8dd Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 19 Dec 2002 21:58:05 +0000
Subject: [PATCH] Deuce's requested change to the set uid stuff during
 initialization that should solve race condition that could occur if one
 server failed to initialize (e.g. bind failure) causing other servers to fail
 to bind when running as user..

---
 src/sbbs3/sbbscon.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/sbbscon.c b/src/sbbs3/sbbscon.c
index 72d8a0177a..3380fc4fde 100644
--- a/src/sbbs3/sbbscon.c
+++ b/src/sbbs3/sbbscon.c
@@ -1386,12 +1386,11 @@ int main(int argc, char** argv)
 	else 
 	{
 		bbs_lputs("Waiting for child threads to bind ports...");
-		while(!bbs_stopped && !ftp_stopped && !mail_stopped && !services_stopped
-			&& ((run_bbs && !bbs_running) 
-				|| (run_ftp && !ftp_running) 
-				|| (run_web && !web_running) 
-				|| (run_mail && !mail_running) 
-				|| (run_services && !services_running)))
+		while((run_bbs && !(bbs_running || bbs_stopped)) 
+				|| (run_ftp && !(ftp_running || ftp_stopped)) 
+				|| (run_web && !(web_running || web_stopped)) 
+				|| (run_mail && !(mail_running || mail_stopped)) 
+				|| (run_services && !(services_running || services_stopped)))
 			mswait(1);
 
 		if(!do_setuid())
-- 
GitLab