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:
Assar Westerlund
1997-03-23 05:08:34 +00:00
parent c8bfd588e5
commit 639c39cc33

View File

@@ -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);