Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 42c3f41

Browse files
author
Jeff Brown
committed
Add more logging to track down disk I/O errors.
Bug: 6538393 Change-Id: Iaa20c8bc01c53da08ff18cb1efae80c2be0b0584
1 parent 61fb99d commit 42c3f41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dist/sqlite3.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28484,7 +28484,7 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){
2848428484
SimulateIOError( rc=1 );
2848528485
if( rc!=0 ){
2848628486
((unixFile*)id)->lastErrno = errno;
28487-
return SQLITE_IOERR_FSTAT;
28487+
return unixLogError(SQLITE_IOERR_FSTAT, "fstat", ((unixFile*)id)->zPath);
2848828488
}
2848928489
*pSize = buf.st_size;
2849028490

@@ -28519,7 +28519,9 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
2851928519
i64 nSize; /* Required file size */
2852028520
struct stat buf; /* Used to hold return values of fstat() */
2852128521

28522-
if( osFstat(pFile->h, &buf) ) return SQLITE_IOERR_FSTAT;
28522+
if( osFstat(pFile->h, &buf) ) {
28523+
return unixLogError(SQLITE_IOERR_FSTAT, "fstat", pFile->zPath);
28524+
}
2852328525

2852428526
nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk;
2852528527
if( nSize>(i64)buf.st_size ){
@@ -28917,7 +28919,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
2891728919
** with the same permissions.
2891828920
*/
2891928921
if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){
28920-
rc = SQLITE_IOERR_FSTAT;
28922+
rc = unixLogError(SQLITE_IOERR_FSTAT, "fstat", pDbFd->zPath);
2892128923
goto shm_open_err;
2892228924
}
2892328925

@@ -30006,7 +30008,7 @@ static int findCreateFileMode(
3000630008
*pUid = sStat.st_uid;
3000730009
*pGid = sStat.st_gid;
3000830010
}else{
30009-
rc = SQLITE_IOERR_FSTAT;
30011+
rc = unixLogError(SQLITE_IOERR_FSTAT, "stat", zDb);
3001030012
}
3001130013
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){
3001230014
*pMode = 0600;

0 commit comments

Comments
 (0)