diff options
Diffstat (limited to '')
-rw-r--r-- | daemon/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/daemon/main.c b/daemon/main.c index 1a691ab..439138d 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -45,6 +45,7 @@ static SERVICE_STATUS_HANDLE hss; static SERVICE_STATUS sstatus; /* options */ +char *conf_file_name = NULL; static char *instance_name = NULL; static char *priority = NULL; @@ -368,6 +369,11 @@ static BOOL install_service() } strcat( command_line, __argv[0] ); strcat( command_line, " --service" ); + if( conf_file_name ) + { + strcat( command_line, " --conf " ); + strcat( command_line, conf_file_name ); + } if( priority ) { strcat( command_line, " --priority " ); @@ -603,6 +609,7 @@ int main( int argc, char* argv[] ) { static struct option long_options[] = { + { "conf", required_argument, NULL, 'c'}, { "verbose", no_argument, NULL, 'v'}, { "help", no_argument, &help_flag, 1 }, { "version", no_argument, &version_flag, 1 }, @@ -619,7 +626,7 @@ int main( int argc, char* argv[] ) int option_char; int option_index; - option_char = getopt_long( argc, argv, "vhirsI:p:", + option_char = getopt_long( argc, argv, "c:vhirsI:p:", long_options, &option_index ); if( -1 == option_char ) break; @@ -629,6 +636,10 @@ int main( int argc, char* argv[] ) case 0: break; + case 'c': + conf_file_name = optarg; + break; + case 'v': verbosity_level++; break; @@ -736,6 +747,7 @@ int main( int argc, char* argv[] ) printf( "Usage: syslogd [OPTION]\n" ); printf( "This is syslog daemon for windows.\n" ); printf( "\n" ); + printf( "-c, --conf\tspecify alternate configuration file\n" ); printf( "-v, --verbose\tbe verbose; each occurence of this parameter\n" "\t\tincreases verbosity\n" ); printf( "-i, --install\tinstall and start service\n" ); |