1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

The BTree changes are now integrated and the whole thing compiles and

links. I have not yet tried to run it, though. (CVS 239)

FossilOrigin-Name: a0a1e701abc52a164d9b09a5426eb12af1fe6a4c
This commit is contained in:
drh
2001-09-13 14:46:09 +00:00
parent 5e00f6c7d5
commit be0072d249
22 changed files with 170 additions and 2868 deletions

View File

@@ -27,7 +27,7 @@
** all writes in order to support rollback. Locking is used to limit
** access to one or more reader or to one writer.
**
** @(#) $Id: pager.c,v 1.14 2001/09/13 13:46:57 drh Exp $
** @(#) $Id: pager.c,v 1.15 2001/09/13 14:46:10 drh Exp $
*/
#include "sqliteInt.h"
#include "pager.h"
@@ -476,7 +476,7 @@ static const char *findTempDir(void){
struct stat buf;
for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
if( stat(azDirs[i], &buf)==0 && S_ISDIR(buf.st_mode)
&& S_IWUSR(buf.st_mode) ){
&& access(azDirs[i], W_OK) ){
return azDirs[i];
}
}
@@ -515,11 +515,11 @@ int sqlitepager_open(
tempFile = 0;
}else{
int cnt = 8;
char *zDir = findTempDir();
const char *zDir = findTempDir();
if( zDir==0 ) return SQLITE_CANTOPEN;
do{
cnt--;
sprintf(zTemp,"%s/_sqlite_%u",(unsigned)sqliteRandomInteger());
sprintf(zTemp,"%s/_sqlite_%u", zDir, (unsigned)sqliteRandomInteger());
fd = open(zTemp, O_RDWR|O_CREAT|O_EXCL, 0600);
}while( cnt>0 && fd<0 );
zFilename = zTemp;
@@ -1138,7 +1138,7 @@ int sqlitepager_rollback(Pager *pPager){
** if the database is (in theory) writable.
*/
int sqlitepager_isreadonly(Pager *pPager){
return pPager->readonly;
return pPager->readOnly;
}
/*