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

Diff for /OpenXM/src/kxx/oxd.c between version 1.3 and 1.8

version 1.3, 2002/10/20 23:49:12 version 1.8, 2004/09/17 03:28:21
Line 1 
Line 1 
 /*  /*
  $OpenXM: OpenXM/src/kxx/oxd.c,v 1.2 2002/10/20 23:38:12 takayama Exp $   $OpenXM: OpenXM/src/kxx/oxd.c,v 1.7 2004/02/25 23:14:36 takayama Exp $
 */  */
   
 #include <stdio.h>  #include <stdio.h>
Line 17 
Line 17 
 #include "ox_kan.h"  #include "ox_kan.h"
 #include "serversm.h"  #include "serversm.h"
   
   /* #define DEBUG */
   
 char *getTag(char *s);  char *getTag(char *s);
 char *getKeyValue(char *s,char *key);  char *getKeyValue(char *s,char *key);
 char *getBody(char *s);  char *getBody(char *s);
Line 31  int Serial = 0;
Line 33  int Serial = 0;
 int LocalMode = 1;  int LocalMode = 1;
 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  
 #define NOBODY 65534  #define NOBODY 65534
   
 main(int argc, char *argv[]) {  main(int argc, char *argv[]) {
Line 134  childServerMain(int fd) {
Line 133  childServerMain(int fd) {
   char ccc[SIZE*3];    char ccc[SIZE*3];
   extern int Serial;    extern int Serial;
   char *openxm;    char *openxm;
     int resultCode;
     int st;
   
   /* Starting oxd session */    /* Starting oxd session */
   signal(SIGALRM,exitServer);    signal(SIGALRM,exitServer);
   alarm(60);    alarm(60);
Line 188  childServerMain(int fd) {
Line 190  childServerMain(int fd) {
   openxm = getOpenXMpath();    openxm = getOpenXMpath();
   sprintf(ccc,"%s %s",openxm,body);    sprintf(ccc,"%s %s",openxm,body);
   fprintf(stderr,"Serial=%d : Executing command=%s\n",Serial,ccc);    fprintf(stderr,"Serial=%d : Executing command=%s\n",Serial,ccc);
     /*  Old code.
   fprintf(fp,"<bye/>\n"); fflush(NULL);    fprintf(fp,"<bye/>\n"); fflush(NULL);
   fclose(fp); /* close the connection */    fclose(fp);
   system(ccc);    system(ccc);
   fprintf(stderr,"Serial=%d : The following command is finished : %s\n",Serial,ccc);    fprintf(stderr,"Serial=%d : The following command is finished : %s\n",Serial,ccc);
      */
     /* New code. It requires  ox with -finish option. */
     resultCode = system(ccc);
     fprintf(stderr,"Serial=%d : The following command is finished : %s, resultCode=%d\n",Serial,ccc,resultCode);
     if (resultCode == 0) {
           fprintf(fp,"<suceeded/>\n");
     }else{
           fprintf(fp,"<failed code=\"%d\"/>\n",resultCode);
     }
   
     GET_COMMAND   /* expect <login/> */
   
     fclose(fp); /* close the connection */
     fprintf(stderr,"Waiting the termination of the child process (ox server).\n");
     fflush(NULL);
     wait(&st);
     fprintf(stderr,"%d: The child process is terminated.\n",Serial);
     exit(0);
 }  }
   
 char *getOpenXMpath() {  char *getOpenXMpath() {
Line 223  oxdError(char *s) {
Line 244  oxdError(char *s) {
 }  }
   
   
   void *sGC_malloc(int n) { return (void *) GC_malloc(n); }
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

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