diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-09-07 21:55:07 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-09-07 21:55:07 +0000 |
commit | 783e3baacc9e101c540fd2cb39e94c02d32f8e72 (patch) | |
tree | 5fb17f49e3d60ea7bcb449f1329ee04a1b5a0de1 /bin/bbackupd/bbackupd.cpp | |
parent | e2efafa787ffa1b45063551b6832a9590141dceb (diff) |
Don't initialise MemLeakFinder twice when running as a service.
Return a non-zero exit code if running as a service fails.
(merges [1813])
Diffstat (limited to 'bin/bbackupd/bbackupd.cpp')
-rw-r--r-- | bin/bbackupd/bbackupd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/bbackupd/bbackupd.cpp b/bin/bbackupd/bbackupd.cpp index b8c8f61a..e094d499 100644 --- a/bin/bbackupd/bbackupd.cpp +++ b/bin/bbackupd/bbackupd.cpp @@ -25,6 +25,8 @@ int main(int argc, const char *argv[]) { + int ExitCode = 0; + MAINHELPER_START Logging::SetProgramName("Box Backup (bbackupd)"); @@ -65,8 +67,6 @@ int main(int argc, const char *argv[]) EnableBackupRights(); - int ExitCode = 0; - if (runAsWin32Service) { BOX_INFO("Box Backup service starting"); @@ -77,7 +77,7 @@ int main(int argc, const char *argv[]) config = strdup(argv[2]); } - OurService(config); + ExitCode = OurService(config); if (config) { @@ -94,14 +94,14 @@ int main(int argc, const char *argv[]) delete gpDaemonService; - return ExitCode; - #else // !WIN32 BackupDaemon daemon; - return daemon.Main(BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv); + ExitCode = daemon.Main(BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv); #endif // WIN32 MAINHELPER_END + + return ExitCode; } |