[Box Backup-commit] COMMIT r1593 - box/chris/merge/lib/server

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 28 Apr 2007 18:35:01 +0100


Author: chris
Date: 2007-04-28 18:35:01 +0100 (Sat, 28 Apr 2007)
New Revision: 1593

Modified:
   box/chris/merge/lib/server/ServerStream.h
Log:
Don't fork to handle requests when running as a single process (very
useful for debugging). (refs #3)


Modified: box/chris/merge/lib/server/ServerStream.h
===================================================================
--- box/chris/merge/lib/server/ServerStream.h	2007-04-28 17:33:50 UTC (rev 1592)
+++ box/chris/merge/lib/server/ServerStream.h	2007-04-28 17:35:01 UTC (rev 1593)
@@ -230,7 +230,7 @@
 					{
 						// Since this is a template parameter, the if() will be optimised out by the compiler
 						#ifndef WIN32 // no fork on Win32
-						if(ForkToHandleRequests)
+						if(ForkToHandleRequests && !IsSingleProcess())
 						{
 							pid_t pid = ::fork();
 							switch(pid)
@@ -285,7 +285,7 @@
 
 				#ifndef WIN32
 				// Clean up child processes (if forking daemon)
-				if(ForkToHandleRequests)
+				if(ForkToHandleRequests && !IsSingleProcess())
 				{
 					int status = 0;
 					int p = 0;
@@ -326,7 +326,7 @@
 		#ifdef WIN32
 		return false;
 		#else
-		return ForkToHandleRequests;
+		return ForkToHandleRequests && !IsSingleProcess();
 		#endif // WIN32
 	}