mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
Windows: only flush buffers on shutdown if running
If a service shutdown message is received prior to the service entering the running state, do not attempt to buf_CleanAndReset() because the required data structures and locks are not initialized. Change-Id: I29f20dbe91230f078334ca58e8791d2422cdecfd Reviewed-on: http://gerrit.openafs.org/5733 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
parent
9cf7a628c2
commit
9743f5729d
@ -249,6 +249,7 @@ afsd_ServiceControlHandlerEx(
|
|||||||
long code;
|
long code;
|
||||||
DWORD dwRet = ERROR_CALL_NOT_IMPLEMENTED;
|
DWORD dwRet = ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
OSVERSIONINFO osVersion;
|
OSVERSIONINFO osVersion;
|
||||||
|
DWORD dwCurrentState = ServiceStatus.dwCurrentState;
|
||||||
|
|
||||||
/* Get the version of Windows */
|
/* Get the version of Windows */
|
||||||
memset(&osVersion, 0x00, sizeof(osVersion));
|
memset(&osVersion, 0x00, sizeof(osVersion));
|
||||||
@ -272,7 +273,8 @@ afsd_ServiceControlHandlerEx(
|
|||||||
SetServiceStatus(StatusHandle, &ServiceStatus);
|
SetServiceStatus(StatusHandle, &ServiceStatus);
|
||||||
|
|
||||||
/* Write all dirty buffers back to server */
|
/* Write all dirty buffers back to server */
|
||||||
if ( !lana_OnlyLoopback() )
|
if (dwCurrentState == SERVICE_RUNNING &&
|
||||||
|
!lana_OnlyLoopback() )
|
||||||
buf_CleanAndReset();
|
buf_CleanAndReset();
|
||||||
|
|
||||||
/* Force trace if requested */
|
/* Force trace if requested */
|
||||||
|
Loading…
Reference in New Issue
Block a user