[BACK]Return to oxmain.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kxx

Diff for /OpenXM/src/kxx/oxmain.c between version 1.12 and 1.16

version 1.12, 2002/10/28 00:38:32 version 1.16, 2004/02/25 23:14:36
Line 1 
Line 1 
 /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.11 2002/05/02 08:33:47 ohara Exp $  */  /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.15 2004/02/23 09:03:43 takayama Exp $  */
 /* nullserver01 */  /* nullserver01 */
 #include <stdio.h>  #include <stdio.h>
 #include <fcntl.h>  #include <fcntl.h>
Line 10 
Line 10 
 #include <netdb.h>  #include <netdb.h>
 #include <signal.h>  #include <signal.h>
 #include <setjmp.h>  #include <setjmp.h>
   #include <stdlib.h>
 /* -lnsl -lsocket /usr/ucblib/libucb.a */  /* -lnsl -lsocket /usr/ucblib/libucb.a */
 #include "ox_kan.h"  #include "ox_kan.h"
 #include "serversm.h"  #include "serversm.h"
   
 #define SERVERNAME "ox_sm1"  #define SERVERNAME "ox_sm1"
   
   extern char **environ;
 int OxCritical = 0;  int OxCritical = 0;
 int OxInterruptFlag = 0;  int OxInterruptFlag = 0;
 int OxTerminateMode = 0;  int OxTerminateMode = 0;
Line 34  int Do_not_use_control_stream_to_tell_no_server = 1;
Line 36  int Do_not_use_control_stream_to_tell_no_server = 1;
 static void errorToStartEngine(void);  static void errorToStartEngine(void);
 static int findOxServer(char *server);  static int findOxServer(char *server);
 static void couldNotFind(char *s);  static void couldNotFind(char *s);
 #if defined(__CYGWIN__)  
 int errno;  
 #endif  
 /*  gcc -v -c hoge.c */  /*  gcc -v -c hoge.c */
   
   void *sGC_malloc(int n) {
     return (void *)malloc(n);
   }
   
 main(int argc, char *argv[]) {  main(int argc, char *argv[]) {
   int fd;    int fd;
   int size;    int size;
Line 269  parentServerMain(int fdControl, int fdStream) {
Line 272  parentServerMain(int fdControl, int fdStream) {
         }          }
   }    }
   
   controlByteOrder = oxTellMyByteOrder(fdControl);    controlByteOrder = oxTellMyByteOrder(fdControl,fdControl);
   /* Set the network byte order. */    /* Set the network byte order. */
   fprintf(stderr,"controlByteOrder=%x\n",controlByteOrder);    fprintf(stderr,"controlByteOrder=%x\n",controlByteOrder);
   
Line 326  childServerMain(int fdControl, int fdStream) {
Line 329  childServerMain(int fdControl, int fdStream) {
     }      }
   }    }
   fprintf(stderr,"childServerMain: Starting the server %s\n",ServerName); fflush(NULL);    fprintf(stderr,"childServerMain: Starting the server %s\n",ServerName); fflush(NULL);
   
     /*
     {
           int i;
           i=0;
           while (environ[i] != NULL) {
             fprintf(stderr,"%s ",environ[i++]);
           }
           fprintf(stderr,"\n");
     }
     */
     /* bug: xterm of potato does not seem to pass the LD_LIBRARY_PATH.
         So, the new gc does not work.
        it is an workaround for OpenXM */
     if (getenv("LD_LIBRARY_PATH") == (char *)NULL) {
           char *s,*o;
       fprintf(stderr,"Hmm... LD_LIBRARY_PATH does not seem to be set.\n");
       o = getenv("OpenXM_HOME");
           if (o == NULL) {
             fprintf(stderr,"Giving up to set the LD_LIBRARY_PATH variable.\n");
           }else{
             s = (char *)malloc(strlen(o)+64);
             sprintf(s,"LD_LIBRARY_PATH=%s/lib",o);
             putenv(s);
           }
     }
   
   if (PacketMonitor) {    if (PacketMonitor) {
     if (execl(ServerName,ServerName,"-monitor",NULL)) {      if (execle(ServerName,ServerName,"-monitor",NULL,environ)) {
       fprintf(stderr,"%s cannot be executed with -monitor.\n",ServerName);        fprintf(stderr,"%s cannot be executed with -monitor.\n",ServerName);
       fflush(NULL);        fflush(NULL);
       return(-1);        return(-1);
     }      }
   }else {    }else {
     if (execl(ServerName,ServerName,NULL)) {      if (execle(ServerName,ServerName,NULL,environ)) {
       fprintf(stderr,"%s cannot be executed.\n",ServerName);        fprintf(stderr,"%s cannot be executed.\n",ServerName);
       fflush(NULL);        fflush(NULL);
       return(-1);        return(-1);
Line 350  restoreLockCtrlCForOx() { ; }
Line 380  restoreLockCtrlCForOx() { ; }
 static int findOxServer(char *server) {  static int findOxServer(char *server) {
   char *p;    char *p;
   char *p2;    char *p2;
   char *getenv(char *s);  
   if (strlen(server) == 0) return(-1);    if (strlen(server) == 0) return(-1);
   /* fd = open(server,O_RDONLY); */    /* fd = open(server,O_RDONLY); */
   if (access(server,X_OK&R_OK) == 0) {    if (access(server,X_OK&R_OK) == 0) {

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.16

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>