1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

More changes for 2.0.7. (CVS 293)

FossilOrigin-Name: f8328a5f11801c5124f9a8dace22df3c1cfb2191
This commit is contained in:
drh
2001-10-22 02:58:08 +00:00
parent 01a346616f
commit 6d4abfbee5
25 changed files with 567 additions and 223 deletions

View File

@@ -134,12 +134,18 @@ static struct lockInfo *findLockInfo(int fd){
key.ino = statbuf.st_ino;
pInfo = (struct lockInfo*)sqliteHashFind(&lockHash, &key, sizeof(key));
if( pInfo==0 ){
struct lockInfo *pOld;
pInfo = sqliteMalloc( sizeof(*pInfo) );
if( pInfo==0 ) return 0;
pInfo->key = key;
pInfo->nRef = 1;
pInfo->cnt = 0;
sqliteHashInsert(&lockHash, &pInfo->key, sizeof(key), pInfo);
pOld = sqliteHashInsert(&lockHash, &pInfo->key, sizeof(key), pInfo);
if( pOld!=0 ){
assert( pOld==pInfo );
sqliteFree(pInfo);
pInfo = 0;
}
}else{
pInfo->nRef++;
}
@@ -315,6 +321,7 @@ int sqliteOsOpenExclusive(const char *zFilename, OsFile *pResult){
sqliteOsLeaveMutex();
if( s.pLock==0 ){
close(s.fd);
unlink(zFilename);
return SQLITE_NOMEM;
}
*pResult = s;