1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Ensure master journal file is deleted when a transaction is committed. (CVS 1586)

FossilOrigin-Name: cb3cbe00be9a42e974688016a056053cedb55eef
This commit is contained in:
danielk1977
2004-06-14 09:35:16 +00:00
parent f9d19a6b3f
commit 962398d395
9 changed files with 118 additions and 19 deletions

View File

@@ -620,6 +620,22 @@ int sqlite3OsSync(OsFile *id){
}
}
/*
** Sync the directory zDirname. This is a no-op on operating systems other
** than UNIX.
*/
int sqlite3OsSyncDirectory(const char *zDirname){
int fd;
int r;
fd = open(zDirname, O_RDONLY|O_BINARY, 0644);
if( fd<0 ){
return SQLITE_CANTOPEN;
}
r = fsync(fd);
close(fd);
return ((r==0)?SQLITE_OK:SQLITE_IOERR);
}
/*
** Truncate an open file to a specified size
*/