diff options
author | drh <drh@noemail.net> | 2013-08-19 12:49:06 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-08-19 12:49:06 +0000 |
commit | db78b96111f93c7b183744c76f687ad84e14c567 (patch) | |
tree | 455cba36272a9eaede190e1c5257bd0fb7d27cf3 /src/test_fs.c | |
parent | 700a7fdf833ce71ee46da1292f96e82afa2dd2f2 (diff) | |
parent | 77dfd5bb447381a23791abb35569d39046281f59 (diff) | |
download | sqlite-db78b96111f93c7b183744c76f687ad84e14c567.tar.gz sqlite-db78b96111f93c7b183744c76f687ad84e14c567.zip |
Merge in all the latest updates and enhancements from trunk.
FossilOrigin-Name: 67587a3348b84424b2ab1f2df1ea923a5168e2e4
Diffstat (limited to 'src/test_fs.c')
-rw-r--r-- | src/test_fs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test_fs.c b/src/test_fs.c index 478cad80b..417c81b49 100644 --- a/src/test_fs.c +++ b/src/test_fs.c @@ -195,6 +195,7 @@ static int fsColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ const char *zFile = (const char *)sqlite3_column_text(pCur->pStmt, 1); struct stat sbuf; int fd; + int n; fd = open(zFile, O_RDONLY); if( fd<0 ) return SQLITE_IOERR; @@ -214,8 +215,9 @@ static int fsColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ pCur->nAlloc = nNew; } - read(fd, pCur->zBuf, sbuf.st_size); + n = (int)read(fd, pCur->zBuf, sbuf.st_size); close(fd); + if( n!=sbuf.st_size ) return SQLITE_ERROR; pCur->nBuf = sbuf.st_size; pCur->zBuf[pCur->nBuf] = '\0'; |