Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -1773,16 +1773,18 @@ }else{ rc = 0; } }else{ int i = 0; - do { + for(;;){ rc = osFcntl(pFile->h, F_SETLK, pLock); - if( rc && nRetry ){ - usleep(100 * (++i)); + if( rc && nRetry-- ){ + usleep(100 * (++i)); + }else{ + break; } - }while( !rc && nRetry-- ); + } } return rc; } /*