Re: [Qemu-devel] [PATCH] keep the PID file locked for the lifetime of the process

2012-01-27 Thread Markus Armbruster
Laszlo Ersek writes: > The lockf() call in qemu_create_pidfile() aims at ensuring mutual > exclusion. We shouldn't close the pidfile on success, because that drops > the lock as well [1]: > > "File locks shall be released on first close by the locking process > of any file descriptor for

[Qemu-devel] [PATCH] keep the PID file locked for the lifetime of the process

2012-01-26 Thread Laszlo Ersek
The lockf() call in qemu_create_pidfile() aims at ensuring mutual exclusion. We shouldn't close the pidfile on success, because that drops the lock as well [1]: "File locks shall be released on first close by the locking process of any file descriptor for the file." Coverity may complain