commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject cvs commit: jakarta-commons-sandbox/daemon/src/native/nt/procrun Makefile procrun.c
Date Mon, 16 Jun 2003 17:05:13 GMT
jfclere     2003/06/16 10:05:13

  Modified:    daemon/src/native/nt/procrun Makefile procrun.c
  Log:
  Arrange win9x and add some debugs.
  
  Revision  Changes    Path
  1.2       +5 -1      jakarta-commons-sandbox/daemon/src/native/nt/procrun/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile	17 Feb 2003 15:09:24 -0000	1.1
  +++ Makefile	16 Jun 2003 17:05:13 -0000	1.2
  @@ -1,10 +1,14 @@
   JAVA_HOME=c:/j2sdk1.4.1_01
   INCLUDE=-I. -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
   BIN=.
  +# CFLAGS for debugging
  +#CFLAGS=-DCYGWIN -D_DEBUG
  +# Normal CFLAGS
  +CFLAGS=-DCYGWIN
   
   all: $(BIN)/procrun
   
   $(BIN)/procrun: procrun.c
  -	gcc -mno-cygwin $(INCLUDE) -DCYGWIN procrun.c \
  +	gcc -mno-cygwin $(INCLUDE) $(CFLAGS) procrun.c \
   	-lshlwapi \
   	-o $(BIN)/procrun
  
  
  
  1.23      +16 -4     jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c
  
  Index: procrun.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procrun.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- procrun.c	8 May 2003 18:38:01 -0000	1.22
  +++ procrun.c	16 Jun 2003 17:05:13 -0000	1.23
  @@ -1523,10 +1523,10 @@
   
       if (!program) {
   #ifdef PROCRUN_WINAPP
  -        MessageBox(NULL, "Service not found", env->m->service.name,
  +        MessageBox(NULL, "Service not found ", env->m->service.name,
                            MB_OK | MB_ICONERROR);
   #else
  -        fprintf(stderr, "Service not found%s\n", env->m->service.name); 
  +        fprintf(stderr, "Service not found %s\n", env->m->service.name); 
   #endif
           return -1;
       }
  @@ -1742,6 +1742,7 @@
       *java = NULL;
       if (!GetModuleFileName(NULL, path, MAX_PATH - 
                              strlen(proc->service.name) - 7)) {
  +        DBPRINTF0("GetModuleFileName failed\n");
           return -1;
       } 
       strcat(path, " " PROC_ARG_RUN_SERVICE);
  @@ -1951,7 +1952,7 @@
           CloseServiceHandle(manager);
       }
       else {
  -        DBPRINTF0(NULL);
  +        DBPRINTF0("CreateService failed\n");
           CloseServiceHandle(manager);
           return -1;
       }
  @@ -1959,6 +1960,7 @@
       /* Save parameters in registry */
       save_service_params(proc,java);
   
  +    DBPRINTF0("NT service installed succesfully\n");
       SetEvent(proc->events[0]);
       return 0;
   }
  @@ -1987,7 +1989,7 @@
           return -1;
       }
   
  -    if (!process_args(proc, argc, argv, &java, path)) {
  +    if (process_args(proc, argc, argv, &java, path)) {
            DBPRINTF0("Installing service: process_args failed\n");
            return -1;
       }
  @@ -2033,6 +2035,8 @@
       /* Save parameters in registry */
       save_service_params(proc,java);
   
  +    DBPRINTF0("service installed succesfully\n");
  +    SetEvent(proc->events[0]);
       return 0;
   }
   
  @@ -2234,6 +2238,7 @@
           CloseServiceHandle(manager);
           return -1;
       }
  +    DBPRINTF0("NT service deleted succesfully\n");
       SetEvent(proc->events[0]);
       return 0;
   }
  @@ -2273,6 +2278,8 @@
           DBPRINTF0( "Could not delete the Services registry key.\r\n");
           return -1;
       }
  +    DBPRINTF0("service deleted succesfull\n"
  +    SetEvent(proc->events[0]);
       return 0;
   }
   
  @@ -2566,6 +2573,11 @@
               DBPRINTF0("STOP SERVICE is unimplemented for now");
               break;
           case PROCRUN_CMD_RUN_SERVICE:
  +            if (g_proc_stderr_file==0) {
  +                g_proc_stderr_file = open("c:/jakarta-service.log",O_CREAT|O_APPEND|O_RDWR);
  +                if (g_proc_stderr_file < 0)
  +                    g_proc_stderr_file = 0;
  +            }
               debug_process(argc, argv, env->m);
               env->m->service.mode = 1;
               dispatch_table[0].lpServiceName = env->m->service.name;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message