[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.7 and 1.10

version 1.7, 2001/05/06 07:53:01 version 1.10, 2002/05/02 03:08:28
Line 1 
Line 1 
 /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.6 2000/12/05 05:58:33 ohara Exp $  */  /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.9 2001/12/28 01:20:27 takayama Exp $  */
 /* nullserver01 */  /* nullserver01 */
 #include <stdio.h>  #include <stdio.h>
 #include <fcntl.h>  #include <fcntl.h>
   #include <unistd.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <sys/time.h>  #include <sys/time.h>
Line 32  int Do_not_use_control_stream_to_tell_no_server = 1;
Line 33  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 */
   
   
 main(int argc, char *argv[]) {  main(int argc, char *argv[]) {
   int fd;    int fd;
   int size;    int size;
Line 48  main(int argc, char *argv[]) {
Line 52  main(int argc, char *argv[]) {
   char portfile[1024];    char portfile[1024];
   char *pass;    char *pass;
   int result;    int result;
     int sleepingTime = 0;
   
   strcpy(sname,"localhost");    strcpy(sname,"localhost");
   strcpy(ServerName,SERVERNAME);    strcpy(ServerName,SERVERNAME);
Line 88  main(int argc, char *argv[]) {
Line 93  main(int argc, char *argv[]) {
       if (i<argc) {        if (i<argc) {
         pass = argv[i];          pass = argv[i];
       }        }
       }else if (strcmp(argv[i],"-wait") == 0) {
         i++;
         if (i<argc) {
           sscanf(argv[i],"%d",&sleepingTime);
         }
     }else {      }else {
       fprintf(stderr,"Unknown option %s.\n",argv[i]);        fprintf(stderr,"Unknown option %s.\n",argv[i]);
       oxmainUsage(); exit(10);        oxmainUsage(); exit(10);
Line 103  main(int argc, char *argv[]) {
Line 113  main(int argc, char *argv[]) {
     }      }
   }    }
   
     if (sleepingTime) {
       fprintf(stderr,"Waiting to connect for %d seconds...\n",sleepingTime);
       sleep(sleepingTime);
       fprintf(stderr,"\nTrying to connect\n");
     }
   
   if (reverse) {    if (reverse) {
     /* The order is very important. */      /* The order is very important. */
     fdControl = socketConnectWithPass(sname,portControl,pass);      fdControl = socketConnectWithPass(sname,portControl,pass);
Line 321  static int findOxServer(char *server) {
Line 337  static int findOxServer(char *server) {
   int fd;    int fd;
   char *getenv(char *s);    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); */
     fd = access(server,X_OK&R_OK);
   if (fd >= 0) {    if (fd >= 0) {
     fprintf(stderr,"Starting OX server : %s\n",server);      fprintf(stderr,"Starting OX server : %s\n",server);
     close(fd);      close(fd);
Line 339  static int findOxServer(char *server) {
Line 356  static int findOxServer(char *server) {
   p2 = (char *) malloc(sizeof(char)*(strlen(p)+strlen("/bin/")+3+strlen(server)));    p2 = (char *) malloc(sizeof(char)*(strlen(p)+strlen("/bin/")+3+strlen(server)));
   if (p2 == NULL) { fprintf(stderr,"No more memory.\n"); exit(10); }    if (p2 == NULL) { fprintf(stderr,"No more memory.\n"); exit(10); }
   strcpy(p2,p); strcat(p2,"/bin/"); strcat(p2,server);    strcpy(p2,p); strcat(p2,"/bin/"); strcat(p2,server);
   fd = open(p2,O_RDONLY);    /* fd = open(p2,O_RDONLY); */
     fd = access(p2,X_OK&R_OK);
   if (fd >= 0) {    if (fd >= 0) {
     fprintf(stderr,"Starting OX server : %s\n",p2);      fprintf(stderr,"Starting OX server : %s\n",p2);
     if (strlen(p2) < SERVERNAME_SIZE) strcpy(server,p2);      if (strlen(p2) < SERVERNAME_SIZE) strcpy(server,p2);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10

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