diff options
author | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-12 20:50:00 +0000 |
---|---|---|
committer | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-12 20:50:00 +0000 |
commit | 3bedf8846f4d7a5cb38276b274662d62a36dcd52 (patch) | |
tree | 9d51de8b0f3d06ba6549a5a1958e52f592343140 /bin/bbackupquery/bbackupquery.cpp | |
parent | 81d8eda2419e7a23088a98cdfc52a305c9ceac0d (diff) |
Marged chris/win32/merge/07-win32-fixes at r210 to trunk
Diffstat (limited to 'bin/bbackupquery/bbackupquery.cpp')
-rwxr-xr-x | bin/bbackupquery/bbackupquery.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp index 1eb86db6..d76664fb 100755 --- a/bin/bbackupquery/bbackupquery.cpp +++ b/bin/bbackupquery/bbackupquery.cpp @@ -56,6 +56,19 @@ int main(int argc, const char *argv[]) { MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT("bbackupquery.memleaks", "bbackupquery") +#ifdef WIN32 + WSADATA info; + + // Under Win32 we must initialise the Winsock library + // before using it. + + if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + { + // throw error? perhaps give it its own id in the furture + THROW_EXCEPTION(BackupStoreException, Internal) + } +#endif + // Really don't want trace statements happening, even in debug mode #ifndef NDEBUG BoxDebugTraceOn = false; @@ -253,7 +266,11 @@ int main(int argc, const char *argv[]) MAINHELPER_END - exit(returnCode); +#ifdef WIN32 + // Clean up our sockets + WSACleanup(); +#endif + return returnCode; } |