Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add more logging to track down disk I/O errors.

Bug: 6538393
Change-Id: Iaa20c8bc01c53da08ff18cb1efae80c2be0b0584
  • Loading branch information...
commit 42c3f41862cfff8d4539903e47a42cae97d13d37 1 parent 61fb99d
Jeff Brown authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 dist/sqlite3.c
View
10 dist/sqlite3.c
@@ -28484,7 +28484,7 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){
SimulateIOError( rc=1 );
if( rc!=0 ){
((unixFile*)id)->lastErrno = errno;
- return SQLITE_IOERR_FSTAT;
+ return unixLogError(SQLITE_IOERR_FSTAT, "fstat", ((unixFile*)id)->zPath);
}
*pSize = buf.st_size;
@@ -28519,7 +28519,9 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
i64 nSize; /* Required file size */
struct stat buf; /* Used to hold return values of fstat() */
- if( osFstat(pFile->h, &buf) ) return SQLITE_IOERR_FSTAT;
+ if( osFstat(pFile->h, &buf) ) {
+ return unixLogError(SQLITE_IOERR_FSTAT, "fstat", pFile->zPath);
+ }
nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
if( nSize>(i64)buf.st_size ){
@@ -28917,7 +28919,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
** with the same permissions.
*/
if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){
- rc = SQLITE_IOERR_FSTAT;
+ rc = unixLogError(SQLITE_IOERR_FSTAT, "fstat", pDbFd->zPath);
goto shm_open_err;
}
@@ -30006,7 +30008,7 @@ static int findCreateFileMode(
*pUid = sStat.st_uid;
*pGid = sStat.st_gid;
}else{
- rc = SQLITE_IOERR_FSTAT;
+ rc = unixLogError(SQLITE_IOERR_FSTAT, "stat", zDb);
}
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){
*pMode = 0600;
Please sign in to comment.
Something went wrong with that request. Please try again.