Handle lockDate being nil.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14612 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
alexm 2002-10-01 00:24:04 +00:00
parent 7efb3e5c9d
commit 804ad341cd
2 changed files with 14 additions and 2 deletions

View file

@ -1184,10 +1184,18 @@ static NSString *pathForUser(NSString *user)
while ([_fileLock tryLock] == NO)
{
CREATE_AUTORELEASE_POOL(arp);
NSDate *when;
NSDate *when, *lockDate;
lockDate = [_fileLock lockDate];
/* If the lock has already been released, lockDate will be nil. If
so, just try again. */
if (!lockDate)
{
RELEASE(arp);
continue;
}
when = [NSDate dateWithTimeIntervalSinceNow: 0.1];
if ([when timeIntervalSinceDate: [_fileLock lockDate]] > 5.0)
if ([when timeIntervalSinceDate: lockDate] > 5.0)
{
[_fileLock breakLock];
}