Author: markt
Date: Fri Nov 4 14:58:34 2016
New Revision: 1768047
URL: http://svn.apache.org/viewvc?rev=1768047&view=rev
Log:
Fix DAEMON-322
Ensure that the PID file on Windows, if used, is readable by other processes.
Modified:
commons/proper/daemon/trunk/src/changes/changes.xml
commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
Modified: commons/proper/daemon/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/changes/changes.xml?rev=1768047&r1=1768046&r2=1768047&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/changes/changes.xml (original)
+++ commons/proper/daemon/trunk/src/changes/changes.xml Fri Nov 4 14:58:34 2016
@@ -54,9 +54,13 @@
stop.
</action>
<action issue="DAEMON-343" type="fix" dev="markt">
- Update config.guess and config.sub to add support, amongst others for
+ Update config.guess and config.sub to add support, amongst others, for
64-bit PowerPC Little-Endian architecture.
</action>
+ <action issue="DAEMON-332" type="fix" dev="markt">
+ Ensure that the PID file on Windows, if used, is readable by other
+ processes.
+ </action>
</release>
</body>
</document>
Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=1768047&r1=1768046&r2=1768047&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
(original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Fri
Nov 4 14:58:34 2016
@@ -1221,8 +1221,7 @@ static DWORD serviceStart()
FILE_SHARE_READ,
NULL,
CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL |
- FILE_FLAG_DELETE_ON_CLOSE,
+ FILE_ATTRIBUTE_NORMAL,
NULL);
if (gPidfileHandle != INVALID_HANDLE_VALUE) {
@@ -1546,6 +1545,9 @@ BOOL docmdDebugService(LPAPXCMDLINE lpCm
serviceMain(0, NULL);
apxLogWrite(APXLOG_MARK_INFO "Debug service finished with exit code %d",
gExitval);
SAFE_CLOSE_HANDLE(gPidfileHandle);
+ if (gPidfileName) {
+ DeleteFileW(gPidfileName);
+ }
return gExitval == 0 ? TRUE : FALSE;
}
@@ -1569,6 +1571,9 @@ BOOL docmdRunService(LPAPXCMDLINE lpCmdl
rv = FALSE;
}
SAFE_CLOSE_HANDLE(gPidfileHandle);
+ if (gPidfileName) {
+ DeleteFileW(gPidfileName);
+ }
return rv;
}