On Sun, 01 Oct 2006 16:07:19 +0300, <[EMAIL PROTECTED]> wrote:

Author: erijo
Date: Sun Oct  1 15:07:18 2006
New Revision: 4644

URL: http://svn.licq.org/viewvc/licq?rev=4644&view=rev
Log:
Redo the "only one instance of Licq" logic.

Instead of checking if the pid in licq.pid is running, use advisory locking. First we grab a write lock on licq.pid. If it fails, this means that licq is already running, otherwise we're alone. By never closing the file, we keep the lock until licq is killed (normally or abnormally) when the kernel will close all open files and remove all locks.

Fixes #1353.

Could you please make sure licq.pid is created with 0644 perms
instead of 0355, as it is now done at my environment with umask 0022.

Lack of u+r makes impossible any second start up.

Reproduce algorithm:
1) latest svn;
2) rm -f ~/.licq/licq.pid
3) start licq
4) ls -l ~/.licq/licq.pid
(For me this gives --wxr-xr-x == 355)
5) quit licq
6) start licq
xmessage: [ERR] Licq: Unabled to determine pid of running Licq instance.

BTW, why unable_D_ ? ;-)

--
Eugene Paskevich             |   *==)-----------   |     Plug me into
[EMAIL PROTECTED]        |   -----------(==*   |      The Matrix

Reply via email to