=================================================================== RCS file: /home/cvs/OpenXM/src/util/ox_pathfinder.c,v retrieving revision 1.29 retrieving revision 1.31 diff -u -p -r1.29 -r1.31 --- OpenXM/src/util/ox_pathfinder.c 2006/01/10 11:52:56 1.29 +++ OpenXM/src/util/ox_pathfinder.c 2010/08/30 04:17:17 1.31 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/util/ox_pathfinder.c,v 1.28 2004/10/14 10:08:09 takayama Exp $ */ +/* $OpenXM: OpenXM/src/util/ox_pathfinder.c,v 1.30 2006/01/26 08:36:50 takayama Exp $ */ /* Moved from misc-2003/07/cygwin/test.c */ #include @@ -14,6 +14,8 @@ #include #include "ox_pathfinder.h" +void *sGC_malloc(int); + int OX_P_stdin = -1; int OX_P_stdout = -1; int OX_P_stderr = -1; @@ -38,8 +40,9 @@ static int Verbose_get_home = 0; static int Verbose = 1; static int NoX = 0; static int ErrorVerbose = 1; +static int EngineLogToStdout = 0; -#define nomemory(a) {fprintf(stderr,"(%d) no more memory.\n",a);exit(10);} +#define nomemory(a) {fprintf(stderr,"(%p) no more memory.\n",(void *)a);exit(10);} #define mymalloc(a) sGC_malloc(a) void pathFinderErrorVerbose(int k) { @@ -170,7 +173,7 @@ int oxForkExec(char **argv) { sigaddset(&sss,SIGINT); sigprocmask(SIG_BLOCK,&sss,NULL); } - if (NoX) { + if (NoX && (!EngineLogToStdout)) { FILE *null; null = fopen("/dev/null","wb"); if (OX_P_stdout >= 0) dup2(OX_P_stdout,1); else dup2(fileno(null),1); @@ -215,7 +218,7 @@ int oxForkExecBlocked(char **argv) { sigaddset(&sss,SIGINT); sigprocmask(SIG_BLOCK,&sss,NULL); } - if (NoX) { + if (NoX && (!EngineLogToStdout)) { FILE *null; null = fopen("/dev/null","wb"); if (OX_P_stdout >= 0) dup2(OX_P_stdout,1); else dup2(fileno(null),1); @@ -1204,3 +1207,7 @@ int oxpSendStringAsFile(char *user,char *hostname, cha char *oxpReadOneTimePasswordFromFile(char *filename) { } + +int ox_pathfinderEngineLogToStdout(int state) { + EngineLogToStdout = state; +}