You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/01/08 02:52:56 UTC

svn commit: r897078 - in /commons/proper/daemon/trunk/src: native/nt/moni/ native/nt/procrun/src/ native/nt/supcalls_nt/ native/unix/native/ samples/

Author: sebb
Date: Fri Jan  8 01:52:47 2010
New Revision: 897078

URL: http://svn.apache.org/viewvc?rev=897078&view=rev
Log:
Tab police

Modified:
    commons/proper/daemon/trunk/src/native/nt/moni/vdmoniadm.c
    commons/proper/daemon/trunk/src/native/nt/moni/vdmonisvc.c
    commons/proper/daemon/trunk/src/native/nt/procrun/src/gui.c
    commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c
    commons/proper/daemon/trunk/src/native/nt/supcalls_nt/vdenv.c
    commons/proper/daemon/trunk/src/native/unix/native/arguments.c
    commons/proper/daemon/trunk/src/native/unix/native/java.c
    commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
    commons/proper/daemon/trunk/src/samples/AloneService.java
    commons/proper/daemon/trunk/src/samples/Native.c
    commons/proper/daemon/trunk/src/samples/ServiceDaemon.java

Modified: commons/proper/daemon/trunk/src/native/nt/moni/vdmoniadm.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/moni/vdmoniadm.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/moni/vdmoniadm.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/moni/vdmoniadm.c Fri Jan  8 01:52:47 2010
@@ -33,11 +33,11 @@
 #define WINHEIGHT 460
 
 #define CLASSMAIN
-#define VM_ICON_MESS	WM_USER+1
-#define VM_ID_TIMER		WM_USER+2
-#define VM_START_ICON	WM_USER+3
-#define VM_ID_TIMER1	WM_USER+4
-#define VM_ID_TIMER2	WM_USER+5
+#define VM_ICON_MESS    WM_USER+1
+#define VM_ID_TIMER     WM_USER+2
+#define VM_START_ICON   WM_USER+3
+#define VM_ID_TIMER1    WM_USER+4
+#define VM_ID_TIMER2    WM_USER+5
 
 BOOL InitApplication(HANDLE hInstance);
 
@@ -79,20 +79,20 @@
 BOOL MyTaskBarAddIcon(HWND hWnd)
 { 
     BOOL res; 
-	NOTIFYICONDATA  notifyicondata;
-	HICON hicon;
+    NOTIFYICONDATA  notifyicondata;
+    HICON hicon;
  
-	notifyicondata.cbSize=sizeof(notifyicondata); 
-	notifyicondata.hWnd=hWnd; 
-	notifyicondata.uID=ID_TASKICON; 
-	notifyicondata.uFlags= NIF_ICON|NIF_MESSAGE|NIF_TIP; 
-	notifyicondata.uCallbackMessage=VM_ICON_MESS;
-	hicon = LoadIcon(hInst,"OnServe");
+    notifyicondata.cbSize=sizeof(notifyicondata); 
+    notifyicondata.hWnd=hWnd; 
+    notifyicondata.uID=ID_TASKICON; 
+    notifyicondata.uFlags= NIF_ICON|NIF_MESSAGE|NIF_TIP; 
+    notifyicondata.uCallbackMessage=VM_ICON_MESS;
+    hicon = LoadIcon(hInst,"OnServe");
     notifyicondata.hIcon = hicon;
-	strcpy(notifyicondata.szTip,"Jakarta Service");
+    strcpy(notifyicondata.szTip,"Jakarta Service");
 
 
-	res = Shell_NotifyIcon(NIM_ADD,&notifyicondata);
+    res = Shell_NotifyIcon(NIM_ADD,&notifyicondata);
  
     if (hicon) 
         DestroyIcon(hicon); 
@@ -130,8 +130,8 @@
    
   if (!CreateProcess(NULL,"vdcom.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
          NULL,NULL, &StartupInfo, &ProcessInformation)) {
-	  DisplayMess(hDlg,CANNOT_START_VDCOM);
-	  return;
+      DisplayMess(hDlg,CANNOT_START_VDCOM);
+      return;
      }
   /* the handle to the process */
   CloseHandle(ProcessInformation.hProcess); 
@@ -148,8 +148,8 @@
    
   if (!CreateProcess(NULL,"vdconf.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,      
          NULL,NULL, &StartupInfo, &ProcessInformation)) {
-	  DisplayMess(hDlg,CANNOT_START_VDCONF);
-	  return;
+      DisplayMess(hDlg,CANNOT_START_VDCONF);
+      return;
      }
   /* the handle to the process */
   CloseHandle(ProcessInformation.hProcess); 
@@ -161,16 +161,16 @@
 {
   SERVICE_STATUS  svcStatus;
 
-	if (!QueryServiceStatus(hService, &svcStatus)) {
-		DisplayMess(hDlg,ERROR_STATUS);
-		PostQuitMessage(0);
-		return(FALSE);
-	}
-	else {
-		if (SERVICE_RUNNING == svcStatus.dwCurrentState)
-			return(TRUE);
-	}
-	return(FALSE);
+    if (!QueryServiceStatus(hService, &svcStatus)) {
+        DisplayMess(hDlg,ERROR_STATUS);
+        PostQuitMessage(0);
+        return(FALSE);
+    }
+    else {
+        if (SERVICE_RUNNING == svcStatus.dwCurrentState)
+            return(TRUE);
+    }
+    return(FALSE);
 
 }
 /* test if service is stoppped */
@@ -178,16 +178,16 @@
 {
   SERVICE_STATUS  svcStatus;
 
-	if (!QueryServiceStatus(hService, &svcStatus)) {
-		DisplayMess(hDlg,ERROR_STATUS);
-		PostQuitMessage(0);
-		return(FALSE);
-	}
-	else {
-		if (SERVICE_STOPPED == svcStatus.dwCurrentState)
-			return(TRUE);
-	}
-	return(FALSE);
+    if (!QueryServiceStatus(hService, &svcStatus)) {
+        DisplayMess(hDlg,ERROR_STATUS);
+        PostQuitMessage(0);
+        return(FALSE);
+    }
+    else {
+        if (SERVICE_STOPPED == svcStatus.dwCurrentState)
+            return(TRUE);
+    }
+    return(FALSE);
 
 }
 /* Yes/No dialog box */
@@ -197,24 +197,24 @@
         UINT wParam,              /* message-specific information    */
         LONG lParam)
 {
-	SERVICE_STATUS  svcStatus;
-	
-	switch (message) {
-	case WM_COMMAND:                     /* message: received a command */
-		if (LOWORD(wParam) == IDOK) {	 /* "OK" box selected */
-			if (!IsStopped(hDlg)) {
-				ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
-				EndDialog(hDlg, TRUE);
-			}
-			else
-				EndDialog(hDlg, FALSE);
-		}
-		if (LOWORD(wParam) == IDCANCEL)
-			EndDialog(hDlg, FALSE);
-		return(TRUE);
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+    SERVICE_STATUS  svcStatus;
+    
+    switch (message) {
+    case WM_COMMAND:                     /* message: received a command */
+        if (LOWORD(wParam) == IDOK) {     /* "OK" box selected */
+            if (!IsStopped(hDlg)) {
+                ControlService(hService, SERVICE_CONTROL_STOP, &svcStatus);
+                EndDialog(hDlg, TRUE);
+            }
+            else
+                EndDialog(hDlg, FALSE);
+        }
+        if (LOWORD(wParam) == IDCANCEL)
+            EndDialog(hDlg, FALSE);
+        return(TRUE);
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
 /* Please wait stopping dialog box */
 LRESULT APIENTRY PleaseWait(
@@ -223,23 +223,23 @@
         UINT wParam,              /* message-specific information    */
         LONG lParam)
 {
-	
-	switch (message) {
-	case WM_INITDIALOG:
-		SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-	case WM_COMMAND:                     /* message: received a command */
-		if (LOWORD(wParam) == IDCANCEL)
-			EndDialog(hDlg, FALSE);
-		return(TRUE);
-	case WM_TIMER:
-		if(IsStopped(hDlg))
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+    
+    switch (message) {
+    case WM_INITDIALOG:
+        SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
+    case WM_COMMAND:                     /* message: received a command */
+        if (LOWORD(wParam) == IDCANCEL)
+            EndDialog(hDlg, FALSE);
+        return(TRUE);
+    case WM_TIMER:
+        if(IsStopped(hDlg))
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER2,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
 LRESULT APIENTRY StartYesNo(
         HWND hDlg,                /* window handle of the dialog box */
@@ -247,40 +247,40 @@
         UINT wParam,              /* message-specific information    */
         LONG lParam)
 {
-	
-	switch (message) {
-	case WM_INITDIALOG:
-		if (!StartService(hService,0,NULL)) {
-			DisplayMess(hDlg,CANNOT_START);
-			PostQuitMessage(0);
-		}
-		/* test if running, if not set a timer. */
-		/* wait until service is start */
-		if (IsRunning(hDlg)) 
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-		
-	case WM_TIMER:
-		if(IsRunning(hDlg))
-			EndDialog(hDlg, TRUE);
-		else
-			SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
-		return(TRUE);
-		
-	case WM_COMMAND:                    /* message: received a command */
-		if (LOWORD(wParam) == IDCANCEL) {
-			if (IsRunning(hDlg)) 
-				EndDialog(hDlg, TRUE);
-			else
-				PostQuitMessage(0);
-		}
-		return(TRUE);
-		
-	} /* End switch message */
-	return (FALSE);                            /* Didn't process a message    */
-	UNREFERENCED_PARAMETER(lParam);
+
+    switch (message) {
+    case WM_INITDIALOG:
+        if (!StartService(hService,0,NULL)) {
+            DisplayMess(hDlg,CANNOT_START);
+            PostQuitMessage(0);
+        }
+        /* test if running, if not set a timer. */
+        /* wait until service is start */
+        if (IsRunning(hDlg)) 
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+        
+    case WM_TIMER:
+        if(IsRunning(hDlg))
+            EndDialog(hDlg, TRUE);
+        else
+            SetTimer(hDlg,VM_ID_TIMER1,5000,NULL); /* wait 5 seconds. */
+        return(TRUE);
+        
+    case WM_COMMAND:                    /* message: received a command */
+        if (LOWORD(wParam) == IDCANCEL) {
+            if (IsRunning(hDlg)) 
+                EndDialog(hDlg, TRUE);
+            else
+                PostQuitMessage(0);
+        }
+        return(TRUE);
+        
+    } /* End switch message */
+    return (FALSE);                            /* Didn't process a message    */
+    UNREFERENCED_PARAMETER(lParam);
 }
 
 /* Display the menu */
@@ -298,7 +298,7 @@
 
    SetForegroundWindow(hWnd); /* MS bug. */
    TrackPopupMenuEx(hMenu1,TPM_RIGHTALIGN|TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
-					point.x,point.y,hWnd,NULL);
+                    point.x,point.y,hWnd,NULL);
    PostMessage(hWnd, WM_USER, 0, 0); /* MS bug. */
    DestroyMenu(hMenu);
 
@@ -316,7 +316,7 @@
     int             nCmdShow)           /* Param for first ShowWindow() call. */
 {
     HWND            hWnd;               /* Main window handle.                */
-	DWORD			dwStyle,dwExStyle;
+    DWORD           dwStyle,dwExStyle;
 
 
     /* Save the instance handle in static variable, which will be used in  */
@@ -326,20 +326,20 @@
 
     /* Create a main window for this application instance.  */
 
-	if (optmode == VDMONISTART || optmode == VDMONICHECK) {
-		dwStyle = ICONWINDOW;
-		dwExStyle = WS_EX_APPWINDOW;
-	}
-	else {
-		dwStyle = NORMALWINDOW;
-		dwExStyle = 0;
-	}
+    if (optmode == VDMONISTART || optmode == VDMONICHECK) {
+        dwStyle = ICONWINDOW;
+        dwExStyle = WS_EX_APPWINDOW;
+    }
+    else {
+        dwStyle = NORMALWINDOW;
+        dwExStyle = 0;
+    }
 
     hWnd = CreateWindowEx(
-		dwExStyle,
+        dwExStyle,
         "OnServe",                      /* See RegisterClass() call.          */
-        "OnServe Monitor Control",		/* Text for window title bar.   */
-        dwStyle,						/* Window style.*/
+        "OnServe Monitor Control",      /* Text for window title bar.   */
+        dwStyle,                        /* Window style.*/
         CW_USEDEFAULT,                  /* Default horizontal position.       */
         CW_USEDEFAULT,                  /* Default vertical position.         */
         WINWIDTH,                       /* Windows width.                     */
@@ -355,7 +355,7 @@
 
     if (!hWnd) {
         return (FALSE);
-	}
+    }
 
     return (TRUE);               /* Returns the value from PostQuitMessage */
 
@@ -379,126 +379,126 @@
    switch (message) {
    case WM_CREATE:
 
-	  /* acces to service manager. */
+      /* acces to service manager. */
       hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-	  if (hManager==NULL) {
-		  DisplayMess(hWnd,NO_ACCESS);
-		  PostQuitMessage(0);
-		  break;
-	  }
-	  /* access to monitor service.  */
+      if (hManager==NULL) {
+          DisplayMess(hWnd,NO_ACCESS);
+          PostQuitMessage(0);
+          break;
+      }
+      /* access to monitor service.  */
       hService = OpenService(hManager, SZSERVICENAME, SERVICE_ALL_ACCESS);
-	  if (hService==NULL) {
-		  DisplayMess(hWnd,NO_ACCESS_MONI);
-		  PostQuitMessage(0);
-		  break;
-	  }
-	  /* check if running. */
+      if (hService==NULL) {
+          DisplayMess(hWnd,NO_ACCESS_MONI);
+          PostQuitMessage(0);
+          break;
+      }
+      /* check if running. */
       if (QueryServiceStatus(hService, &svcStatus)) {       
           /* and see if the service is stopped */
           if (SERVICE_STOPPED == svcStatus.dwCurrentState &&
-			  optmode == VDMONISTOP) {
-			  DisplayMess(hWnd,ALREADY_STOP);
-			  PostQuitMessage(0);
-			  break;
-		  }
-		  else if (SERVICE_RUNNING == svcStatus.dwCurrentState &&
-			  optmode == VDMONISTART) {
-			  DisplayMess(hWnd,ALREADY_START);
-			  PostQuitMessage(0);
-			  break;
-		  }
-
-	  }
-	  else {
-		  DisplayMess(hWnd,ERROR_STATUS);
-		  PostQuitMessage(0);
-		  break;
-	  }
+              optmode == VDMONISTOP) {
+              DisplayMess(hWnd,ALREADY_STOP);
+              PostQuitMessage(0);
+              break;
+          }
+          else if (SERVICE_RUNNING == svcStatus.dwCurrentState &&
+              optmode == VDMONISTART) {
+              DisplayMess(hWnd,ALREADY_START);
+              PostQuitMessage(0);
+              break;
+          }
+
+      }
+      else {
+          DisplayMess(hWnd,ERROR_STATUS);
+          PostQuitMessage(0);
+          break;
+      }
 
       /* DialogBoxes Yes/No */
-	  if (optmode == VDMONISTART)
-		  DialogBox(hInst,				     /* current instance         */
-		        "StartYesNo",                /* resource to use          */
-			    hWnd,                        /* parent handle            */
-				StartYesNo);                 /* instance address         */
-	  else if (optmode == VDMONISTOP)
-		  if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-			  DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-
-	
-	  if (optmode == VDMONISTOP)
-		  PostQuitMessage(0);
-	  else {
-		  SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-		  MyTaskBarAddIcon(hWnd);
-	  }
+      if (optmode == VDMONISTART)
+          DialogBox(hInst,                     /* current instance         */
+                "StartYesNo",                /* resource to use          */
+                hWnd,                        /* parent handle            */
+                StartYesNo);                 /* instance address         */
+      else if (optmode == VDMONISTOP)
+          if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
+              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
+
+    
+      if (optmode == VDMONISTOP)
+          PostQuitMessage(0);
+      else {
+          SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+          MyTaskBarAddIcon(hWnd);
+      }
 
       break;   /* WM_CREATE */
 
    case VM_ICON_MESS:
-	   switch ((UINT)lParam) {
-	   case WM_LBUTTONDBLCLK:
-		   StartVdcom(hWnd);
-		   break;
-	   case WM_RBUTTONDOWN:
-	  	   flagdown = 1;
-		   break;
-	   case WM_RBUTTONUP:
-		   if (flagdown == 1) {
-		   flagdown = 2;
-		   /* show a  menu. */
-		   ShowMenu(hWnd);
-		   }
-		   break;
-	   }
-	   break;
+       switch ((UINT)lParam) {
+       case WM_LBUTTONDBLCLK:
+           StartVdcom(hWnd);
+           break;
+       case WM_RBUTTONDOWN:
+             flagdown = 1;
+           break;
+       case WM_RBUTTONUP:
+           if (flagdown == 1) {
+           flagdown = 2;
+           /* show a  menu. */
+           ShowMenu(hWnd);
+           }
+           break;
+       }
+       break;
 
 
    case WM_TIMER:
-	   /* check if service is running */
+       /* check if service is running */
        if (QueryServiceStatus(hService, &svcStatus)) {       
           /* and see if the service is stopped */
-		   if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
-			   MyTaskBarDeleteIcon(hWnd);
-			   PostQuitMessage(0);
-		   }
-		   SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-		   return(0);
-	   }
-	   break;
+           if (SERVICE_STOPPED == svcStatus.dwCurrentState) {
+               MyTaskBarDeleteIcon(hWnd);
+               PostQuitMessage(0);
+           }
+           SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+           return(0);
+       }
+       break;
 
    case VM_START_ICON:
-	   /* add the icon and timer. */
-	   MyTaskBarAddIcon(hWnd);
-	   SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
-	   break;
+       /* add the icon and timer. */
+       MyTaskBarAddIcon(hWnd);
+       SetTimer(hWnd,VM_ID_TIMER,5000,NULL);
+       break;
 
    case WM_COMMAND:
-	   /* command for the popup menu. */
-	   switch (LOWORD(wParam)) {
-	   case ID_START_VDCOM:
-		   StartVdcom(hWnd);
-		   break;
-	   case ID_STOP_VDMONI:
-    	   if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
-			  DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
-		   break;
-	   case ID_PROPRETY:
-		   StartVdconf(hWnd);
-		   break;
+       /* command for the popup menu. */
+       switch (LOWORD(wParam)) {
+       case ID_START_VDCOM:
+           StartVdcom(hWnd);
+           break;
+       case ID_STOP_VDMONI:
+           if (DialogBox(hInst,"StopYesNo",hWnd,StopYesNo))
+              DialogBox(hInst,"PleaseWait",hWnd,PleaseWait);
+           break;
+       case ID_PROPRETY:
+           StartVdconf(hWnd);
+           break;
 
-	   }
-	   break;
+       }
+       break;
 
   /*
    *   Clean up.
    */
    case WM_DESTROY:
-	   if (hService!=NULL)
-		   CloseServiceHandle(hService);
-	   if (hManager!=NULL) 
-		   CloseServiceHandle(hManager);
+       if (hService!=NULL)
+           CloseServiceHandle(hService);
+       if (hManager!=NULL) 
+           CloseServiceHandle(hManager);
       PostQuitMessage(0);
       break;
 
@@ -529,12 +529,12 @@
     MSG msg;
 
     UNREFERENCED_PARAMETER( lpCmdLine );
-	if (strcmp(lpCmdLine,"start")==0) 
-		optmode = VDMONISTART;
-	else if (strcmp(lpCmdLine,"stop")==0)
-		optmode = VDMONISTOP;
-	else
-		optmode = VDMONICHECK;
+    if (strcmp(lpCmdLine,"start")==0) 
+        optmode = VDMONISTART;
+    else if (strcmp(lpCmdLine,"stop")==0)
+        optmode = VDMONISTOP;
+    else
+        optmode = VDMONICHECK;
 
     if (!hPrevInstance)                  /* Other instances of app running? */
         if (!InitApplication(hInstance)) /* Initialize shared things        */

Modified: commons/proper/daemon/trunk/src/native/nt/moni/vdmonisvc.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/moni/vdmonisvc.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/moni/vdmonisvc.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/moni/vdmonisvc.c Fri Jan  8 01:52:47 2010
@@ -76,13 +76,13 @@
 
         /* Use event logging to log the error. */
 
-	if (isWindowsNT())
+    if (isWindowsNT())
             hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
-	else
-	    hEventSource = NULL;
+    else
+        hEventSource = NULL;
 
 #ifdef CYGWIN
-	sprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
+    sprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
 #else
         _stprintf(szMsg, TEXT("%s ERROR: %d"), TEXT(SZSERVICENAME), dwErr);
 #endif
@@ -102,10 +102,10 @@
 
             (VOID) DeregisterEventSource(hEventSource);
         } else {
-	    /* Default to a trace file */
-	    FILE *log;
-	    log = fopen("c:/jakarta-service.log","a+");
-	    if (log != NULL) {
+        /* Default to a trace file */
+        FILE *log;
+        log = fopen("c:/jakarta-service.log","a+");
+        if (log != NULL) {
                 struct tm *newtime;
                 time_t long_time;
 
@@ -113,12 +113,12 @@
                 newtime = localtime( &long_time );
 
                 if (dwErr)
-		    fprintf(log,"%.24s:%s: %s\n",asctime(newtime),szMsg, lpszMsg);
+            fprintf(log,"%.24s:%s: %s\n",asctime(newtime),szMsg, lpszMsg);
                 else
-		    fprintf(log,"%.24s: %s\n",asctime(newtime), lpszMsg);
-		fclose(log);
-	    }
-	}
+            fprintf(log,"%.24s: %s\n",asctime(newtime), lpszMsg);
+        fclose(log);
+        }
+    }
 }
 
 /*
@@ -410,7 +410,7 @@
  */
 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
 {
-char	Data[512];
+char    Data[512];
 DWORD   qreturn;
 STARTUPINFO StartupInfo;
 PROCESS_INFORMATION ProcessInformation;
@@ -629,9 +629,9 @@
                                                    service_ctrl);
 
     if (!sshStatusHandle) {
-	AddToMessageLog(TEXT("service_main:RegisterServiceCtrlHandler failed"));
+    AddToMessageLog(TEXT("service_main:RegisterServiceCtrlHandler failed"));
         goto cleanup;
-	}
+    }
 
     /* SERVICE_STATUS members that don't change in example */
     ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
@@ -640,9 +640,9 @@
 
     /* report the status to the service control manager. */
     if (!ReportStatusToSCMgr(SERVICE_START_PENDING,NO_ERROR,3000))   {
-	AddToMessageLog(TEXT("service_main:ReportStatusToSCMgr failed"));
+    AddToMessageLog(TEXT("service_main:ReportStatusToSCMgr failed"));
         goto cleanup;
-	}
+    }
 
 
     ServiceStart( dwArgc, lpszArgv );
@@ -693,16 +693,16 @@
         { NULL, NULL }
     };
 
-	AddToMessageLog(TEXT("StartService starting"));
-	if (isWindowsNT()) {
+    AddToMessageLog(TEXT("StartService starting"));
+    if (isWindowsNT()) {
             if (!StartServiceCtrlDispatcher(dispatchTable)) {
-		AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
-		return;
-	    }
-	    AddToMessageLog(TEXT("StartService started"));
-	} else {
-	    Windows9xServiceCtrlHandler();
-	    ServiceStart(argc,argv);
-	    AddToMessageLog(TEXT("StartService stopped"));
-	}
+        AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
+        return;
+        }
+        AddToMessageLog(TEXT("StartService started"));
+    } else {
+        Windows9xServiceCtrlHandler();
+        ServiceStart(argc,argv);
+        AddToMessageLog(TEXT("StartService stopped"));
+    }
 }

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/src/gui.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/src/gui.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/src/gui.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/src/gui.c Fri Jan  8 01:52:47 2010
@@ -609,7 +609,7 @@
     lpOf.lpstrInitialDir = szDefPath;
     lpOf.lpstrFile       = szFile;
     lpOf.nMaxFile        = SIZ_BUFMAX;
- 	lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+    lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
 
     if (bOpenOrSave)
         rv = GetOpenFileNameA(&lpOf);
@@ -644,7 +644,7 @@
     lpOf.lpstrInitialDir = szDefPath;
     lpOf.lpstrFile       = szFile;
     lpOf.nMaxFile        = SIZ_BUFMAX;
- 	lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+    lpOf.Flags = OFN_LONGNAMES | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
 
     if (bOpenOrSave)
         rv = GetOpenFileNameW(&lpOf);

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c Fri Jan  8 01:52:47 2010
@@ -1011,13 +1011,13 @@
     }
     SetLastError(0);
     if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
-	|| GetLastError()) {
+    || GetLastError()) {
         LocalFree( pSD );
         LocalFree( sa );
         return NULL;
     }
     if (!SetSecurityDescriptorDacl(pSD, TRUE, (PACL) NULL, FALSE)
-	|| GetLastError()) {
+    || GetLastError()) {
         LocalFree( pSD );
         LocalFree( sa );
         return NULL;

Modified: commons/proper/daemon/trunk/src/native/nt/supcalls_nt/vdenv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/supcalls_nt/vdenv.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/supcalls_nt/vdenv.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/supcalls_nt/vdenv.c Fri Jan  8 01:52:47 2010
@@ -52,12 +52,12 @@
 int OnServeSetEnv ()
 {
 HKEY    hKey=NULL;
-DWORD	Type;
-char	jakarta_home[ENVSIZE]; /* for the path */
-char	cygwin[ENVSIZE]; /* for the path */
-char	Data[ENVSIZE];
-DWORD	LData;
-int	qreturn=0;
+DWORD   Type;
+char    jakarta_home[ENVSIZE]; /* for the path */
+char    cygwin[ENVSIZE]; /* for the path */
+char    Data[ENVSIZE];
+DWORD   LData;
+int     qreturn=0;
 
 
     /* Read the registry and set environment. */
@@ -122,7 +122,7 @@
  */
 int BuildCommand(char *data)
 {
-    int	i;
+    int  i;
     LONG lRet;
     DWORD dwIndex;
     char name[128];
@@ -130,7 +130,7 @@
     char value[256];
     DWORD lvalue;
     DWORD nvalue;
-    DWORD	Type;
+    DWORD   Type;
     HKEY    hKey=NULL;
 
 

Modified: commons/proper/daemon/trunk/src/native/unix/native/arguments.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/unix/native/arguments.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/unix/native/arguments.c (original)
+++ commons/proper/daemon/trunk/src/native/unix/native/arguments.c Fri Jan  8 01:52:47 2010
@@ -56,7 +56,7 @@
     args->anum=0;               /* Zero class specific arguments but make room*/
     args->outfile="/dev/null";   /* Swallow by default */
     args->errfile="/dev/null";   /* Swallow by default */
-    args->redirectstdin=true;	 /* Redirect stdin to /dev/null by default */
+    args->redirectstdin=true;    /* Redirect stdin to /dev/null by default */
     args->args=(char **)malloc(argc*sizeof(char *));
     args->procname = "jsvc.exec";
     /* Set up the command name */
@@ -205,16 +205,16 @@
               return (NULL);
             }
 
-	/* -agentlib: -agentpath: -javaagent: 1.5.x JVM */
+    /* -agentlib: -agentpath: -javaagent: 1.5.x JVM */
         } else if (strstr(argv[x],"-agentlib:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-agentpath:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-javaagent:")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);
-	    
+
         } else if (strstr(argv[x],"-")==argv[x]) {
             log_error("Invalid option %s",argv[x]);
             return(NULL);

Modified: commons/proper/daemon/trunk/src/native/unix/native/java.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/unix/native/java.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/unix/native/java.c (original)
+++ commons/proper/daemon/trunk/src/native/unix/native/java.c Fri Jan  8 01:52:47 2010
@@ -173,8 +173,8 @@
     /* Prepare the VM initialization arguments */
     
     /*
-    	Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
-    	is specified. So use JNI_VERSION_1_4 if we can.
+        Mac OS X Java will load JVM 1.3.1 instead of 1.4.2 if JNI_VERSION_1_2
+        is specified. So use JNI_VERSION_1_4 if we can.
     */
     #if defined(JNI_VERSION_1_4)
         arg.version=JNI_VERSION_1_4;

Modified: commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c (original)
+++ commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Fri Jan  8 01:52:47 2010
@@ -133,10 +133,10 @@
             } else
                 log_debug("Cannot set supplement group list for user '%s'",user);
         }
-	if (getuid() == uid) {
+    if (getuid() == uid) {
             log_debug("No need to change user to '%s'!",user);
             return(0);
-	}
+    }
         if (setuid(uid)!=0) {
             log_error("Cannot set user id for user '%s'",user);
             return(-1);

Modified: commons/proper/daemon/trunk/src/samples/AloneService.java
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/samples/AloneService.java?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/samples/AloneService.java (original)
+++ commons/proper/daemon/trunk/src/samples/AloneService.java Fri Jan  8 01:52:47 2010
@@ -56,7 +56,7 @@
         prop = new ExtendedProperties("startfile");
 
         /* create an array to store the processes */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
             e.next();
             i++;
@@ -80,7 +80,7 @@
         System.err.println("ServiceDaemon: starting");
 
         /* Start */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
            String name = (String) e.next();
            System.err.println("ServiceDaemon: starting: " + name + " : " + prop.getString(name));

Modified: commons/proper/daemon/trunk/src/samples/Native.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/samples/Native.c?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/samples/Native.c (original)
+++ commons/proper/daemon/trunk/src/samples/Native.c Fri Jan  8 01:52:47 2010
@@ -31,10 +31,10 @@
  */
 JNIEXPORT void JNICALL Java_SimpleDaemon_toto
   (JNIEnv *env, jclass class) {
-	int i;
-	i = -1;
-	memcpy(&i, &i, i);
-	memset(&i, ' ', 1024);
+    int i;
+    i = -1;
+    memcpy(&i, &i, i);
+    memset(&i, ' ', 1024);
 }
  
 #ifdef __cplusplus

Modified: commons/proper/daemon/trunk/src/samples/ServiceDaemon.java
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/samples/ServiceDaemon.java?rev=897078&r1=897077&r2=897078&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/samples/ServiceDaemon.java (original)
+++ commons/proper/daemon/trunk/src/samples/ServiceDaemon.java Fri Jan  8 01:52:47 2010
@@ -62,7 +62,7 @@
         prop = new ExtendedProperties("startfile");
 
         /* create an array to store the processes */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
             e.next();
             i++;
@@ -86,7 +86,7 @@
         System.err.println("ServiceDaemon: starting");
 
         /* Start */
-	int i=0;
+        int i=0;
         for (Iterator e = prop.getKeys(); e.hasNext() ;) {
            String name = (String) e.next();
            System.err.println("ServiceDaemon: starting: " + name + " : " + prop.getString(name));