summaryrefslogtreecommitdiff
path: root/bin/bbackupd/bbackupd.cpp
diff options
context:
space:
mode:
authorBen Summers <ben@fluffy.co.uk>2006-02-13 13:30:21 +0000
committerBen Summers <ben@fluffy.co.uk>2006-02-13 13:30:21 +0000
commit830aa82e44381c85d8486e46de7ae0e26830457e (patch)
treef29edb3c3013990a3ae758e1ccfdb56a2d20923f /bin/bbackupd/bbackupd.cpp
parent2edd0a00e3244cc4dbc369d81ed1748768a06fb8 (diff)
Merge chris/win32/vc2005-compile-fixes @ r455, add infrastructure/msvc to distribution
Diffstat (limited to 'bin/bbackupd/bbackupd.cpp')
-rw-r--r--bin/bbackupd/bbackupd.cpp12
1 files changed, 9 insertions, 3 deletions
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();