From: Jeffrey Altman Date: Mon, 8 Dec 2003 04:01:20 +0000 (+0000) Subject: set-service-error-condition-afsd-20031207 X-Git-Tag: openafs-devel-1_3_51~28 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=705241efee4119b0f5c089771e5384a8a0dc9d66;p=packages%2Fo%2Fopenafs.git set-service-error-condition-afsd-20031207 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. --- diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index 4946eb852..3e491b484 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -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;