version 1.5, 2003/11/20 07:18:41 |
version 1.7, 2006/01/26 08:36:50 |
|
|
/* $OpenXM: OpenXM/src/kxx/ox100start.c,v 1.4 2003/07/21 13:36:42 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kxx/ox100start.c,v 1.6 2004/02/28 12:27:15 takayama Exp $ */ |
/* Moved from misc-2003/07/cygwin/test.c */ |
/* Moved from misc-2003/07/cygwin/test.c */ |
#include <stdio.h> |
#include <stdio.h> |
#include <sys/types.h> |
#include <sys/types.h> |
Line 17 void *sGC_malloc(int size) { |
|
Line 17 void *sGC_malloc(int size) { |
|
return ((void *)malloc(size)); |
return ((void *)malloc(size)); |
} |
} |
|
|
|
int Quiet = 0; |
|
static int EngineLogToStdout = 0; |
extern char **environ; |
extern char **environ; |
|
|
main(int argc,char *argv[]) { |
main(int argc,char *argv[]) { |
Line 58 main(int argc,char *argv[]) { |
|
Line 60 main(int argc,char *argv[]) { |
|
aaa = getServerEnv(serverName); |
aaa = getServerEnv(serverName); |
}else if (strcmp(argv[i],"-nox")==0) { |
}else if (strcmp(argv[i],"-nox")==0) { |
ox_pathfinderNoX(1); |
ox_pathfinderNoX(1); |
|
}else if (strcmp(argv[i],"-engineLogToStdout")==0) { |
|
ox_pathfinderEngineLogToStdout(1); |
|
EngineLogToStdout = 1; |
|
}else if (strcmp(argv[i],"-quiet")==0) { |
|
Quiet = 1; ox_pathfinder_quiet(); |
}else{ |
}else{ |
fprintf(stderr,"Unknown option.\n"); |
fprintf(stderr,"Unknown option.\n"); |
usage(); |
usage(); |
Line 90 static void myforkwait() { |
|
Line 97 static void myforkwait() { |
|
} |
} |
|
|
static void usage() { |
static void usage() { |
fprintf(stderr,"oxstart100 -oxserver xxx [-e args]\n"); |
fprintf(stderr,"ox100start -oxserver xxx [-e args]\n"); |
fprintf(stderr,"Examples: \n"); |
fprintf(stderr,"Examples: \n"); |
fprintf(stderr," oxstart100 -oxserver bin/ox_sm1 -e -reverse -data 3010 --control 3012 -pass 1121343432434 \n"); |
fprintf(stderr," ox100start -oxserver bin/ox_sm1 -e -reverse -data 3010 --control 3012 -pass 1121343432434 \n"); |
|
fprintf(stderr," ox100start -nox -engineLogToStdout -oxserver bin/ox_sm1 -e -data 3010 \n"); |
|
|
} |
} |
|
|
static int forkExec(char **argv) { |
static int forkExec(char **argv) { |
Line 122 static int forkExec(char **argv) { |
|
Line 131 static int forkExec(char **argv) { |
|
sigaddset(&sss,SIGINT); |
sigaddset(&sss,SIGINT); |
sigprocmask(SIG_BLOCK,&sss,NULL); |
sigprocmask(SIG_BLOCK,&sss,NULL); |
} |
} |
if (ox_pathfinderNoX(-1)) { |
if (ox_pathfinderNoX(-1) && (!EngineLogToStdout)) { |
FILE *null; |
FILE *null; |
null = fopen("/dev/null","wb"); |
null = fopen("/dev/null","wb"); |
dup2(fileno(null),1); |
dup2(fileno(null),1); |