]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
set-service-error-condition-afsd-20031207
authorJeffrey Altman <jaltman@grand.central.org>
Mon, 8 Dec 2003 04:01:20 +0000 (04:01 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 8 Dec 2003 04:01:20 +0000 (04:01 +0000)
TICKET 2619

If the service crashes unexpectedly (eg, when the network adapter list
changes) we should return an error code so that system policy can be
used to determine if the service should be automatically restarted.
When there is an error GlobalStatus gets set to a non-zero value.
If GlobalStatus is set, we will return ERROR_EXCEPTION_IN_SERVICE
to the Service Manager.

src/WINNT/afsd/afsd_service.c

index 4946eb8520431aa12a5f269fcf1fa35c0d852ead..3e491b48419d0c5fdce5164c03690064efe3d1b6 100644 (file)
@@ -334,7 +334,7 @@ void afsd_Main()
     }
 
        ServiceStatus.dwCurrentState = SERVICE_STOPPED;
-       ServiceStatus.dwWin32ExitCode = NO_ERROR;
+       ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR;
        ServiceStatus.dwCheckPoint = 0;
        ServiceStatus.dwWaitHint = 0;
        ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;