commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1003799 - in /commons/proper/daemon/trunk/src/native/windows: apps/prunsrv/prunsrv.c src/log.c
Date Sat, 02 Oct 2010 13:41:12 GMT
Author: mturk
Date: Sat Oct  2 13:41:12 2010
New Revision: 1003799

URL: http://svn.apache.org/viewvc?rev=1003799&view=rev
Log:
More parameter checks and error message displays

Modified:
    commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
    commons/proper/daemon/trunk/src/native/windows/src/log.c

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=1003799&r1=1003798&r2=1003799&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Sat Oct  2 13:41:12
2010
@@ -851,6 +851,14 @@ static DWORD WINAPI serviceStop(LPVOID l
     else if (SO_STOPMODE) { /* Only in case we have a stop mode */
         DWORD nArgs;
         LPWSTR *pArgs;
+        
+        if (!SO_STOPIMAGE) {
+            apxLogWrite(APXLOG_MARK_ERROR "Missing service ImageFile");
+            if (!_service_mode)
+                apxDisplayError(FALSE, NULL, 0, "Service '%S' is missing the ImageFile",
+                                _service_name ? _service_name : L"unknown");
+            return 1;                        
+        }
         /* Redirect process */
         hWorker = apxCreateProcessW(gPool,
                                     0,
@@ -1020,6 +1028,13 @@ static DWORD serviceStart()
         apxLogWrite(APXLOG_MARK_DEBUG "Java started %s", _jni_rclass);
     }
     else {
+        if (!SO_STARTIMAGE) {
+            apxLogWrite(APXLOG_MARK_ERROR "Missing service ImageFile");
+            if (!_service_mode)
+                apxDisplayError(FALSE, NULL, 0, "Service '%S' is missing the ImageFile",
+                                _service_name ? _service_name : L"unknown");
+            return 1;                        
+        }
         /* Redirect process */
         gWorker = apxCreateProcessW(gPool,
                                     0,

Modified: commons/proper/daemon/trunk/src/native/windows/src/log.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/log.c?rev=1003799&r1=1003798&r2=1003799&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/log.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/log.c Sat Oct  2 13:41:12 2010
@@ -426,7 +426,8 @@ apxDisplayError(
         }
         else {
             fputs(sysbuf, stderr);
-            fputc('\n', stderr);
+            if (!szFormat)
+                fputc('\n', stderr);
             fflush(stderr);
         }
     }



Mime
View raw message