-C Added\stests\sfor\ssqlite3_changes\safter\sa\sDELETE.\s(CVS\s1798)
-D 2004-07-15T20:08:39
+C Use\sthe\sF_FULLFSYNC\sfctrl\sif\sit\sis\savailable.\s\sRecord\sthe\sname\sof\sfiles\nthat\sare\sopened\sin\sthe\sOsFile\sstructure.\s(CVS\s1799)
+D 2004-07-17T21:44:57
F Makefile.in 77d1219b6563476711a7a962e865979a6f314eb0
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/os_mac.h 51d2445f47e182ed32d3bd6937f81070c6fd9bd4
F src/os_test.c 6bf10100de2ca199a91fe7ac6474561c8a7166ae
F src/os_test.h 6a26a4978492e4bbdbf385554958418ff02db162
-F src/os_unix.c 7df6ae05faa5b84164193d3694cb71b66661bbf3
-F src/os_unix.h 00c1f82b526ab2fb7ee5ddd555ea4ed68363c93a
+F src/os_unix.c 7dca8d07ac1d6e2b589eda6d536a4d143160a0f3
+F src/os_unix.h c3ee271744327d156a9e016dff965adebadffdfb
F src/os_win.c 54181eb73cb4783c4241feca9eaa490768b39008
F src/os_win.h babd4e912967c6b09088cfe38a45e8005a07ba44
F src/pager.c 5f8cdc92ee9efb5a7849dc8b561b53122b700c78
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P c44943e6fe0c88830102253591a501dc7d724d2f
-R 6372bb8eea811521fd1d8c72d50b1f51
+P c01f13267f592dc2678e78ea45dadddcdc154f82
+R a9f4dab888d922312d00d87de0e5cb2e
U drh
-Z 3cb2ad30190c7832bdc46e58738a9e26
+Z d985f788c605dfd4069fa22794ea5ba6
-c01f13267f592dc2678e78ea45dadddcdc154f82
\ No newline at end of file
+1d30d0dd46c2bd12ce3f7dc06492f3e27ab6bcee
\ No newline at end of file
return SQLITE_OK;
}
+/*
+** The fsync() system call does not work as advertised on many
+** unix systems. The following procedure is an attempt to make
+** it work better.
+*/
+static int full_fsync(int fd){
+ int rc;
+#ifdef F_FULLFSYNC
+ rc = fcntl(fd, F_FULLFSYNC, 0);
+ if( rc ) rc = fsync(fd);
+#else
+ rc = fsync(fd);
+#endif
+ return rc;
+}
+
/*
** Make sure all writes to a particular file are committed to disk.
**
assert( id->isOpen );
SimulateIOError(SQLITE_IOERR);
TRACE2("SYNC %-3d\n", id->h);
- if( fsync(id->h) ){
+ if( full_fsync(id->h) ){
return SQLITE_IOERR;
}
if( id->dirfd>=0 ){
TRACE2("DIRSYNC %-3d\n", id->dirfd);
- fsync(id->dirfd);
+ full_fsync(id->dirfd);
close(id->dirfd); /* Only need to sync once, so close the directory */
id->dirfd = -1; /* when we are done. */
}
*/
int sqlite3OsClose(OsFile *id){
if( !id->isOpen ) return SQLITE_OK;
+ id->zFilename = 0;
sqlite3OsUnlock(id, NO_LOCK);
if( id->dirfd>=0 ) close(id->dirfd);
id->dirfd = -1;
struct openCnt *pOpen; /* Info about all open fd's on this inode */
struct lockInfo *pLock; /* Info about locks on this inode */
int h; /* The file descriptor */
+ const char *zFilename; /* Name passed to open() */
unsigned char locktype; /* The type of lock held on this fd */
unsigned char isOpen; /* True if needs to be closed */
int dirfd; /* File descriptor for the directory */