char** argv;
} osm_main_args_t;
+osm_main_args_t osm_main_args;
+
+
/**********************************************************************
**********************************************************************/
void show_usage(void);
*/
const struct option long_option[] =
{
- { "debug", 1, NULL, 'd'},
+ { "service", 0, NULL, 'Z'},
+ { "debug", 1, NULL, 'd'},
{ "guid", 1, NULL, 'g'},
{ "ignore_guids", 1, NULL, 'i'},
{ "lmc", 1, NULL, 'l'},
long_option, NULL);
switch(next_option)
{
- case 'o':
+ case 'Z':
+ /*
+ service option - nothing to do
+ */
+ break;
+
+ case 'o':
/*
Run once option.
*/
{
int i;
boolean_t run_as_service = FALSE;
- osm_main_args_t osm_main_args;
osm_main_args.argc = argc;
osm_main_args.argv = argv;
/* If there are arguments that the executable is ran with, then this is
switch(Opcode)
{
- case SERVICE_CONTROL_STOP:
+ case SERVICE_CONTROL_SHUTDOWN:
+ case SERVICE_CONTROL_STOP:
// Do whatever it takes to stop here.
osm_exit_flag = TRUE;
OsmServiceStatus.dwWin32ExitCode = 0;
OsmServiceStatus.dwServiceType = SERVICE_WIN32;
OsmServiceStatus.dwCurrentState = SERVICE_START_PENDING;
OsmServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_PAUSE_CONTINUE;
+ SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_SHUTDOWN;
OsmServiceStatus.dwWin32ExitCode = 0;
OsmServiceStatus.dwServiceSpecificExitCode = 0;
OsmServiceStatus.dwCheckPoint = 0;
DWORD OsmServiceInitialization(DWORD argc, LPTSTR *argv,
DWORD *specificError)
{
- osm_main_args_t osm_main_args;
- osm_main_args.argc = argc;
- osm_main_args.argv = argv;
if (CreateThread(NULL, 0, opensm_main, &osm_main_args, 0, NULL) == NULL)
{
SvcDebugOut(" [OSM_SERVICE] failed to create thread (%d)\n",