From: drh Date: Tue, 9 Jan 2007 17:18:19 +0000 (+0000) Subject: Fix the windows OS layer so that it returns detailed IOERR error codes. (CVS 3583) X-Git-Tag: version-3.6.10~2587 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cce710942d9e80285d74c81d6818329449c7aa0;p=thirdparty%2Fsqlite.git Fix the windows OS layer so that it returns detailed IOERR error codes. (CVS 3583) FossilOrigin-Name: 4b36de46c42e2e42d611b38ff18949bea55c803b --- diff --git a/manifest b/manifest index 128900972c..e9f04d0e41 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Work\saround\swin2k\sproblems\sso\sthat\ssingle-character\sfilenames\scan\sbe\nused.\s\sTicket\s#2151.\s(CVS\s3582) -D 2007-01-09T15:32:18 +C Fix\sthe\swindows\sOS\slayer\sso\sthat\sit\sreturns\sdetailed\sIOERR\serror\scodes.\s(CVS\s3583) +D 2007-01-09T17:18:19 F Makefile.in 7fa74bf4359aa899da5586e394d17735f221315f F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -83,7 +83,7 @@ F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_unix.c 9fbbd8ab0a6b3992370ba0f3aae11feff2a78c96 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e -F src/os_win.c 788ae0fa4528d25ec9eb027c204500b83c63f8c6 +F src/os_win.c 8999403beb4b442393b59723b3d54da0ee7d343b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/pager.c d6ad66eb119602cb2e6a097f8f635372ba677d23 F src/pager.h 2e6d42f4ae004ae748a037b8468112b851c447a7 @@ -424,7 +424,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 31a661d424d0fe03eaf78f98031e360102dafeff -R 0fc4861290a912ccbd1bba5ded51a7c9 +P c4eb2100c39356e1816cc6514d65155e47ea1a1d +R 9ef1c294013987fe571d02b84a6957c1 U drh -Z 5a70f6674cbfeef83c200da7a448ff2a +Z f4ba755d06fed28592673c450bbce8fe diff --git a/manifest.uuid b/manifest.uuid index 93f334cd4c..7dbab4fdee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c4eb2100c39356e1816cc6514d65155e47ea1a1d \ No newline at end of file +4b36de46c42e2e42d611b38ff18949bea55c803b \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 3842ba94e5..59d759902a 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -1000,7 +1000,7 @@ static int winClose(OsFile **pId){ static int winRead(OsFile *id, void *pBuf, int amt){ DWORD got; assert( id!=0 ); - SimulateIOError(return SQLITE_IOERR); + SimulateIOError(return SQLITE_IOERR_READ); TRACE3("READ %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype); if( !ReadFile(((winFile*)id)->h, pBuf, amt, &got, 0) ){ return SQLITE_IOERR_READ; @@ -1021,7 +1021,7 @@ static int winWrite(OsFile *id, const void *pBuf, int amt){ int rc = 0; DWORD wrote; assert( id!=0 ); - SimulateIOError(return SQLITE_IOERR); + SimulateIOError(return SQLITE_IOERR_READ); SimulateDiskfullError(return SQLITE_FULL); TRACE3("WRITE %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype); assert( amt>0 ); @@ -1081,7 +1081,7 @@ static int winSync(OsFile *id, int dataOnly){ ** than UNIX. */ int sqlite3WinSyncDirectory(const char *zDirname){ - SimulateIOError(return SQLITE_IOERR); + SimulateIOError(return SQLITE_IOERR_READ); return SQLITE_OK; } @@ -1092,7 +1092,7 @@ static int winTruncate(OsFile *id, i64 nByte){ LONG upperBits = nByte>>32; assert( id!=0 ); TRACE3("TRUNCATE %d %lld\n", ((winFile*)id)->h, nByte); - SimulateIOError(return SQLITE_IOERR); + SimulateIOError(return SQLITE_IOERR_TRUNCATE); SetFilePointer(((winFile*)id)->h, nByte, &upperBits, FILE_BEGIN); SetEndOfFile(((winFile*)id)->h); return SQLITE_OK; @@ -1104,7 +1104,7 @@ static int winTruncate(OsFile *id, i64 nByte){ static int winFileSize(OsFile *id, i64 *pSize){ DWORD upperBits, lowerBits; assert( id!=0 ); - SimulateIOError(return SQLITE_IOERR); + SimulateIOError(return SQLITE_IOERR_FSTAT); lowerBits = GetFileSize(((winFile*)id)->h, &upperBits); *pSize = (((i64)upperBits)<<32) + lowerBits; return SQLITE_OK; @@ -1365,7 +1365,7 @@ static int winUnlock(OsFile *id, int locktype){ if( locktype==SHARED_LOCK && !getReadLock(pFile) ){ /* This should never happen. We should always be able to ** reacquire the read lock */ - rc = SQLITE_IOERR; + rc = SQLITE_IOERR_UNLOCK; } } if( type>=RESERVED_LOCK ){