Project

General

Profile

« Previous | Next » 

Revision 8c98de67

Added by Hamish Coleman almost 16 years ago

  • ID 8c98de6710a5f14cf6be23f2104becf34e4855e1

Clean up the main function some more

View differences:

wconsd.c
int main(int argc, char **argv)
{
DWORD err;
// debug info for when I test this as a service
dprintf(1,"wconsd: started with argc==%i\n",argc);
......
// assume that our messages are going to the debug log
debug_mode=0;
err = SCM_Start(&sd);
if (err!=SVC_CONSOLE) {
if (SCM_Start(&sd)!=SVC_CONSOLE) {
return 0;
}
......
dprintf(1,
" (see http://wob.zot.org/2/wiki/wconsd for more info)\n\n");
/* we have decided to run as a console app.. */
if (do_getopt(GETOPT_INIT,argc,argv)) {
int r;
dprintf(1,"wconsd: Foreground mode\n");
r=wconsd_init(0,NULL);
if (r!=0) {
dprintf(1,"wconsd: wconsd_init failed, return code %d\n",r);
return 1;
}
wconsd_main(0);
/* we are running as a console app so simulate the SCM */
/* TODO - this could all be done inside the *-scm.c code */
int r=wconsd_init(argc,argv);
if (r!=0) {
dprintf(1,"wconsd: wconsd_init failed, return code %d\n",r);
return 1;
}
dprintf(1,"wconsd: Foreground mode\n");
wconsd_main(0);
return 0;
}

Also available in: Unified diff