utils.cpp: Fix stupid bug in LockFile::isLocked()
commitce6f838b4587528630784c1ea1ad272b64e78544
authorjlh <jlh@gmx.ch>
Sun, 25 May 2008 22:04:43 +0000 (26 00:04 +0200)
committerjlh <jlh@gmx.ch>
Sun, 25 May 2008 22:30:20 +0000 (26 00:30 +0200)
treeb06674bdf1cfe3ef0ec0450bb5d898ee830a2598
parente289eeaa747b274297bb592d300ad0774138c826
utils.cpp: Fix stupid bug in LockFile::isLocked()

Due to this bug, the lock on the lock file wasn't released, the
file not closed and not removed.  One would think that when the
application exits, the file gets closed and thus the lock gets
released.  But that wasn't always the case.

When dbus-daemon wasn't running yet, then Skype Call Recorder
would automagically start it.  Unfortunately it inherits the open
fd to the lock file as well as the lock itself.  This isn't a
duplicate of the lock, it's actually the very same lock and if any
of the two programs would release it, it would be gone (or if both
programs close the file).

Since Skype Call Recorder failed to release the lock due to this
bug (and closing the file isn't enough, all fds need to be closed
for automatic release), the lock continued to exist and Skype Call
Recorder could not be started again.
utils.cpp