windows: Added lockf function and lock PID file
authorPaul Boca <pboca@cloudbasesolutions.com>
Mon, 25 Jul 2016 12:50:33 +0000 (12:50 +0000)
committerGurucharan Shetty <guru@ovn.org>
Mon, 25 Jul 2016 13:47:54 +0000 (06:47 -0700)
commit568b9dc8871582f968bd9e66a69a35b9acf93602
treed0500a0b2f6d1b22a51cf70b4abf126e92b256a3
parentece9c2947dd5956708bcdb44922a2481da6b2f50
windows: Added lockf function and lock PID file

If the PID file isn't locked then appctl.py detects it as stale and
bails out without doing anything. Because of this lots of Python tests fail.
Also this protects the PID file from being overwritten.

I used only shared lock, in order to be compatible with Python tests,
which try to acquire the lock exclusively. On Windows if the exclusive lock
is used, than the read access is denied too for other instances of this file.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
lib/daemon-windows.c