Make global lockfile actually work
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1485 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -60,11 +60,13 @@ otp_db_open (void)
|
||||
close(lock);
|
||||
break;
|
||||
}
|
||||
if (stat (OTP_DB_LOCK, &statbuf) == 0) {
|
||||
if (time(NULL) - statbuf.st_mtime > OTP_DB_TIMEOUT)
|
||||
unlink (OTP_DB_LOCK);
|
||||
else
|
||||
sleep (1);
|
||||
}
|
||||
}
|
||||
if (i == RETRIES)
|
||||
return NULL;
|
||||
ret = dbm_open (OTP_DB, O_RDWR | O_CREAT, 0600);
|
||||
|
Reference in New Issue
Block a user