summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/Win32BackupService.cpp26
-rw-r--r--bin/bbackupd/bbackupd.cpp2
2 files changed, 10 insertions, 18 deletions
diff --git a/bin/bbackupd/Win32BackupService.cpp b/bin/bbackupd/Win32BackupService.cpp
index 7cbf4828..1470b42d 100644
--- a/bin/bbackupd/Win32BackupService.cpp
+++ b/bin/bbackupd/Win32BackupService.cpp
@@ -29,31 +29,23 @@ void TerminateService(void)
DWORD Win32BackupService::WinService(const char* pConfigFileName)
{
- char exepath[MAX_PATH];
- GetModuleFileName(NULL, exepath, sizeof(exepath));
+ DWORD ret;
+
+ // keep MAINHELPER_START happy
+ int argc = 0;
+ char* argv[] = {NULL};
+
+ MAINHELPER_START
- std::string configfile;
-
if (pConfigFileName != NULL)
{
- configfile = pConfigFileName;
+ ret = this->Main(pConfigFileName);
}
else
{
- // make the default config file name,
- // based on the program path
- configfile = exepath;
- configfile = configfile.substr(0,
- configfile.rfind(DIRECTORY_SEPARATOR_ASCHAR));
- configfile += DIRECTORY_SEPARATOR "bbackupd.conf";
+ ret = this->Main(BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE);
}
- const char *argv[] = {exepath, "-c", configfile.c_str()};
- int argc = sizeof(argv) / sizeof(*argv);
- DWORD ret;
-
- MAINHELPER_START
- ret = this->Main(BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv);
MAINHELPER_END
return ret;
diff --git a/bin/bbackupd/bbackupd.cpp b/bin/bbackupd/bbackupd.cpp
index f7091140..b8c8f61a 100644
--- a/bin/bbackupd/bbackupd.cpp
+++ b/bin/bbackupd/bbackupd.cpp
@@ -89,7 +89,7 @@ int main(int argc, const char *argv[])
else
{
ExitCode = gpDaemonService->Main(
- BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv);
+ BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE, argc, argv);
}
delete gpDaemonService;