diff options
-rw-r--r-- | third_party/sqlite/src/src/os_unix.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/os_unix.c index ef04a72..5bc6955 100644 --- a/third_party/sqlite/src/src/os_unix.c +++ b/third_party/sqlite/src/src/os_unix.c @@ -2829,8 +2829,15 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ #else newOffset = lseek(id->h, offset, SEEK_SET); if( newOffset!=offset ){ + int capturedErrno = errno; /* Capture errno before fprintf(). */ + /* TODO(shess): Tracking a SQLITE_IOERR_WRITE being seen on the + * waterfall. http://crbug.com/56427 */ + fprintf(stderr, "SQLite lseek error in seekAndWrite, " + "offset == %d, rc == %d, errno == %d\n", + (int)offset, (int)newOffset, capturedErrno); + fflush(stderr); if( newOffset == -1 ){ - ((unixFile*)id)->lastErrno = errno; + ((unixFile*)id)->lastErrno = capturedErrno; }else{ ((unixFile*)id)->lastErrno = 0; } @@ -2840,7 +2847,14 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ #endif TIMER_END; if( got<0 ){ - ((unixFile*)id)->lastErrno = errno; + int capturedErrno = errno; /* Capture errno before fprintf(). */ + /* TODO(shess): Tracking a SQLITE_IOERR_WRITE being seen on the + * waterfall. http://crbug.com/56427 */ + fprintf(stderr, "SQLite write error in seekAndWrite, " + "cnt == %d, rc == %d, errno == %d\n", + cnt, got, capturedErrno); + fflush(stderr); + ((unixFile*)id)->lastErrno = capturedErrno; } OSTRACE5("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); |