Fix instance counting bug (incorrect use of fcntl return code).

SVN revision: 32582
This commit is contained in:
Kim Woelders 2007-11-11 17:56:29 +00:00
parent 0092b853de
commit 45e9c1186d
1 changed files with 6 additions and 1 deletions

View File

@ -5727,7 +5727,7 @@ Epplet_find_instance(char *name)
for (;;)
{
err = fcntl(fd, F_SETLK, &fl);
if (err != EINTR)
if (err == 0 || errno != EINTR)
break;
}
if (err == 0)
@ -5736,6 +5736,11 @@ Epplet_find_instance(char *name)
locked = 1;
break;
}
if (errno == EACCES || errno == EAGAIN)
{
/* Locking failed due to held lock */
continue;
}
if (!exists)
{