Merge branch '979-win32-remove-lock-file-upon-shutdown-v9_11' into 'v9_11'

[v9_11] win32: remove lock file upon shutdown

See merge request isc-projects/bind9!1833
This commit is contained in:
Michał Kępień 2019-04-19 05:20:32 -04:00
commit 0aec955235
2 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,6 @@
5214. [bug] win32: named now removes its lock file upon shutdown.
[GL #979]
5213. [bug] win32: Eliminated a race which allowed named.exe running
as a service to be killed prematurely during shutdown.
[GL #978]

View file

@ -350,9 +350,9 @@ ns_os_shutdown(void) {
if (lockfilefd != -1) {
(void) UnlockFile((HANDLE) _get_osfhandle(lockfilefd),
0, 0, 0, 1);
close(lockfilefd);
lockfilefd = -1;
}
cleanup_lockfile();
ntservice_shutdown(); /* This MUST be the last thing done */
}