commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r897075 - in /commons/proper/daemon/trunk/src/native/nt/procrun: apps/prunsrv/prunsrv.c src/registry.c
Date Fri, 08 Jan 2010 01:35:48 GMT
Author: sebb
Date: Fri Jan  8 01:35:46 2010
New Revision: 897075

URL: http://svn.apache.org/viewvc?rev=897075&view=rev
Log:
DAEMON-106 prunsrv.exe //US// always returns exit code 6, even if successful

Modified:
    commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
    commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c?rev=897075&r1=897074&r2=897075&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c Fri Jan  8 01:35:46
2010
@@ -695,7 +695,7 @@
 static BOOL docmdUpdateService(LPAPXCMDLINE lpCmdline)
 {
     APXHANDLE hService;
-    BOOL  rv = FALSE;
+    BOOL  rv = TRUE;
 
     apxLogWrite(APXLOG_MARK_INFO "Updating service...");
 
@@ -721,12 +721,12 @@
             apxLogWrite(APXLOG_MARK_DEBUG "Setting service password %S",
                         SO_SPASSWORD);
         }
-        apxServiceSetNames(hService,
-                           NULL,                /* Never update the ImagePath */
-                           SO_DISPLAYNAME,
-                           SO_DESCRIPTION,
-                           su,
-                           sp);
+        rv = (rv && apxServiceSetNames(hService,
+                                       NULL,                /* Never update the ImagePath
*/
+                                       SO_DISPLAYNAME,
+                                       SO_DESCRIPTION,
+                                       su,
+                                       sp));
         /* Update the --Startup mode */
         if (ST_STARTUP & APXCMDOPT_FOUND) {
             if (!lstrcmpiW(SO_STARTUP, PRSRV_AUTO))
@@ -738,19 +738,21 @@
             if (!lstrcmpiW(SO_TYPE, STYPE_INTERACTIVE))
                 dwType = SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS;
         }
-        apxServiceSetOptions(hService,
-                             dwType,
-                             dwStart,
-                             SERVICE_NO_CHANGE);
+        rv = (rv && apxServiceSetOptions(hService,
+                                         dwType,
+                                         dwStart,
+                                         SERVICE_NO_CHANGE));
 
         apxLogWrite(APXLOG_MARK_INFO "Service %S updated",
                     lpCmdline->szApplication);
 
-        saveConfiguration(lpCmdline);
+        rv = (rv && saveConfiguration(lpCmdline));
     }
-    else
+    else {
         apxDisplayError(TRUE, NULL, 0, "Unable to open %S service",
                         lpCmdline->szApplication);
+        rv = FALSE;
+    }
     apxCloseHandle(hService);
     apxLogWrite(APXLOG_MARK_INFO "Update service finished.");
     return rv;

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c?rev=897075&r1=897074&r2=897075&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c Fri Jan  8 01:35:46 2010
@@ -1081,7 +1081,7 @@
                         lstrlenW(szDescription) * sizeof(WCHAR));
     SAFE_CLOSE_KEY(hKey);
 
-    return rc = ERROR_SUCCESS;
+    return rc == ERROR_SUCCESS;
 }
 
 BOOL apxGetServiceDescriptionW(LPCWSTR szServiceName, LPWSTR szDescription,



Mime
View raw message