[Box Backup-commit] COMMIT r1692 - box/chris/general/bin/bbackupd
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat May 26 16:34:45 BST 2007
Author: chris
Date: 2007-05-26 16:34:45 +0100 (Sat, 26 May 2007)
New Revision: 1692
Modified:
box/chris/general/bin/bbackupd/Win32BackupService.cpp
Log:
Determine config file path at runtime. Call Daemon::Main with config file
name instead of building fake argv.
Modified: box/chris/general/bin/bbackupd/Win32BackupService.cpp
===================================================================
--- box/chris/general/bin/bbackupd/Win32BackupService.cpp 2007-05-26 15:33:57 UTC (rev 1691)
+++ box/chris/general/bin/bbackupd/Win32BackupService.cpp 2007-05-26 15:34:45 UTC (rev 1692)
@@ -29,31 +29,23 @@
DWORD Win32BackupService::WinService(const char* pConfigFileName)
{
- char exepath[MAX_PATH];
- GetModuleFileName(NULL, exepath, sizeof(exepath));
+ DWORD ret;
- std::string configfile;
-
+ // keep MAINHELPER_START happy
+ int argc = 0;
+ char* argv[] = {NULL};
+
+ MAINHELPER_START
+
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;
More information about the Boxbackup-commit
mailing list