[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.22 and 1.25

version 1.22, 2006/02/04 10:44:22 version 1.25, 2006/06/05 04:40:15
Line 1 
Line 1 
 /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.21 2005/02/28 12:53:44 takayama Exp $  */  /*  $OpenXM: OpenXM/src/kxx/oxmain.c,v 1.24 2006/06/05 00:25:50 takayama Exp $  */
   /*  Note on IntelMac. [2006.06.05]
       SIGINT does not seem to be blocked on the rosetta emulator of ppc
       on the IntelMac's. "ox" should be universal binary.
      A dirty hack to generate a universal binary of ox is as follows.
      (1) Add -arch ppc -arch i386 to CFLAGS in src/kxx/Makefile
          and src/kan96xx/plugin/Makefile
      (2) Build ox
   */
 /* nullserver01 */  /* nullserver01 */
 #include <stdio.h>  #include <stdio.h>
 #include <fcntl.h>  #include <fcntl.h>
Line 6 
Line 14 
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <sys/time.h>  #include <sys/time.h>
   #include <sys/resource.h>
 #include <netinet/in.h>  #include <netinet/in.h>
 #include <netdb.h>  #include <netdb.h>
 #include <signal.h>  #include <signal.h>
Line 33  int Quiet = 0;
Line 42  int Quiet = 0;
 int LocalMode = 1;  int LocalMode = 1;
 int NotifyPortnumber = 0;  int NotifyPortnumber = 0;
 int Do_not_use_control_stream_to_tell_no_server = 1;  int Do_not_use_control_stream_to_tell_no_server = 1;
   int IgnoreSIGINT = 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);
Line 130  main(int argc, char *argv[]) {
Line 140  main(int argc, char *argv[]) {
         fprintf(stderr,"Unknown -authEncoding %s.\n",argv[i]);          fprintf(stderr,"Unknown -authEncoding %s.\n",argv[i]);
         oxmainUsage(); exit(10);          oxmainUsage(); exit(10);
       }        }
       }else if (strcmp(argv[i],"-ignoreSIGINT") == 0) {
         i++;
         if (i<argc) {
           sscanf(argv[i],"%d",&IgnoreSIGINT);
         }
     }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 315  oxmainUsage() {
Line 330  oxmainUsage() {
   fprintf(stderr,"Usage: \n");    fprintf(stderr,"Usage: \n");
   fprintf(stderr,"  ox [-ox serverprogram -host name -data portnum -control portnum -monitor]\n");    fprintf(stderr,"  ox [-ox serverprogram -host name -data portnum -control portnum -monitor]\n");
   fprintf(stderr," [-insecure -portfile fname -reverse -passControl xxxyyyzzz -passData pppqqqrrr]");    fprintf(stderr," [-insecure -portfile fname -reverse -passControl xxxyyyzzz -passData pppqqqrrr]");
   fprintf(stderr," [-finish]");    fprintf(stderr," [-finish]  [-wait seconds] [-authEncoding [file]]");
     fprintf(stderr," [-ignoreSIGINT [1|0]]");
   fprintf(stderr,"\n");    fprintf(stderr,"\n");
   fprintf(stderr,"-reverse: ox server connects to the client.\n");    fprintf(stderr,"-reverse: ox server connects to the client.\n");
   fprintf(stderr,"          The client must give a one time password to ox server to connect to the client with -pass* option.\n");    fprintf(stderr,"          The client must give a one time password to ox server to connect to the client with -pass* option.\n");
Line 409  void myServerExit() {
Line 425  void myServerExit() {
   
 childServerMain(int fdControl, int fdStream) {  childServerMain(int fdControl, int fdStream) {
   int i;    int i;
     struct rlimit res;
   close(fdControl);   /* close(0); dup(fdStream); */    close(fdControl);   /* close(0); dup(fdStream); */
   dup2(fdStream,3);    dup2(fdStream,3);
   dup2(fdStream,4);    dup2(fdStream,4);
Line 448  childServerMain(int fdControl, int fdStream) {
Line 465  childServerMain(int fdControl, int fdStream) {
           putenv(s);            putenv(s);
         }          }
   }    }
     getrlimit(RLIMIT_STACK,&res);
     if (res.rlim_cur < 65536000) {
       fprintf(stderr,"RLIMIT_STACK is increased to 65Mbytes by setrlimit.\n");
           res.rlim_cur = 65536000;
           setrlimit(RLIMIT_STACK,&res);
     }
   
     if (IgnoreSIGINT) { signal(SIGINT, SIG_IGN); fprintf(stderr,"SIGING\n");}
   
   if (PacketMonitor) {    if (PacketMonitor) {
     if (execle(ServerName,ServerName,"-monitor",NULL,environ)) {      if (execle(ServerName,ServerName,"-monitor",NULL,environ)) {

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.25

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