From 830aa82e44381c85d8486e46de7ae0e26830457e Mon Sep 17 00:00:00 2001 From: Ben Summers Date: Mon, 13 Feb 2006 13:30:21 +0000 Subject: Merge chris/win32/vc2005-compile-fixes @ r455, add infrastructure/msvc to distribution --- bin/bbackupd/bbackupd.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bin/bbackupd/bbackupd.cpp') diff --git a/bin/bbackupd/bbackupd.cpp b/bin/bbackupd/bbackupd.cpp index 1c870317..089b2d09 100644 --- a/bin/bbackupd/bbackupd.cpp +++ b/bin/bbackupd/bbackupd.cpp @@ -48,13 +48,19 @@ int main(int argc, const char *argv[]) InstallService(); return 0; } - + + bool runAsWin32Service = false; + if (argc == 2 && ::strcmp(argv[1], "--service") == 0) + { + runAsWin32Service = true; + } + // Under win32 we must initialise the Winsock library // before using sockets WSADATA info; - if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + if (WSAStartup(0x0101, &info) == SOCKET_ERROR) { // box backup will not run without sockets ::syslog(LOG_ERR, "Failed to initialise Windows Sockets"); @@ -65,7 +71,7 @@ int main(int argc, const char *argv[]) int ExitCode = 0; - if (argc == 2 && ::strcmp(argv[1], "--service") == 0) + if (runAsWin32Service) { syslog(LOG_INFO,"Starting Box Backup Service"); OurService(); -- cgit v1.2.3