[Box Backup-dev] COMMIT r679 - box/chris/general/lib/server

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 23 Jul 2006 09:44:30 +0000 (GMT)


Author: chris
Date: 2006-07-23 09:44:24 +0000 (Sun, 23 Jul 2006)
New Revision: 679

Modified:
   box/chris/general/lib/server/Daemon.cpp
Log:
* Daemon.cpp
- Protect WSAStartup and WSACleanup with #ifdef WIN32


Modified: box/chris/general/lib/server/Daemon.cpp
===================================================================
--- box/chris/general/lib/server/Daemon.cpp	2006-07-23 09:28:29 UTC (rev 678)
+++ box/chris/general/lib/server/Daemon.cpp	2006-07-23 09:44:24 UTC (rev 679)
@@ -364,6 +364,7 @@
 		return 1;
 	}
 
+#ifdef WIN32
 	// Under win32 we must initialise the Winsock library
 	// before using sockets
 
@@ -375,6 +376,7 @@
 		::syslog(LOG_ERR, "Failed to initialise Windows Sockets");
 		THROW_EXCEPTION(CommonException, Internal)
 	}
+#endif
 
 	int retcode = 0;
 	
@@ -450,7 +452,9 @@
 		retcode = 1;
 	}
 
+#ifdef WIN32
 	WSACleanup();
+#endif
 	
 	return retcode;
 }