Add -d option for debugging - to suppress daemonisation for profiler and debugger
r1979 | dcl | 2007-05-23 08:55:21 +1000 (Wed, 23 May 2007) | 2 lines
This commit is contained in:
57
SICSmain.c
57
SICSmain.c
@@ -39,30 +39,39 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int iRet;
|
||||
|
||||
/* initialise, will die on you if problems */
|
||||
if(argc >= 2)
|
||||
{
|
||||
iRet = InitServer(argv[1],&pServ);
|
||||
}
|
||||
else
|
||||
{
|
||||
iRet = InitServer(NULL,&pServ);
|
||||
}
|
||||
if(!iRet)
|
||||
{
|
||||
printf("Unrecoverable error on server startup, exiting.........\n");
|
||||
exit(1);
|
||||
}
|
||||
daemon(1,1);
|
||||
|
||||
|
||||
RunServer(pServ);
|
||||
|
||||
StopServer(pServ);
|
||||
pServ = NULL;
|
||||
exit(0);
|
||||
int iRet;
|
||||
int debug = 0;
|
||||
const char* filename = NULL;
|
||||
|
||||
/* initialise, will die on you if problems */
|
||||
if(argc >= 2)
|
||||
{
|
||||
if (strcasecmp(argv[1], "-d") == 0)
|
||||
{
|
||||
debug = 1;
|
||||
if (argc > 2)
|
||||
filename = argv[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = argv[1];
|
||||
}
|
||||
}
|
||||
iRet = InitServer(filename, &pServ);
|
||||
if(!iRet)
|
||||
{
|
||||
printf("Unrecoverable error on server startup, exiting.........\n");
|
||||
exit(1);
|
||||
}
|
||||
if (debug == 0)
|
||||
daemon(1,1);
|
||||
|
||||
|
||||
RunServer(pServ);
|
||||
|
||||
StopServer(pServ);
|
||||
pServ = NULL;
|
||||
exit(0);
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
SicsInterp *GetInterpreter(void)
|
||||
|
||||
Reference in New Issue
Block a user