From 4a53cdbc34a55cf344334db2af0c7cf0a8feaf1f Mon Sep 17 00:00:00 2001 From: pweilbacher Date: Sun, 28 Jan 2007 21:12:13 +0000 Subject: [PATCH] Adapt returns of the os2Read() function to those of other platforms using checkin (3549) to prevent possible corruption (CVS 3617) FossilOrigin-Name: ba76107cd1fc1898f5357b20b339727e2e034e23 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_os2.c | 9 ++++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 7b4e64a732..905b50d199 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.3.12\s(CVS\s3616) -D 2007-01-27T14:30:15 +C Adapt\sreturns\sof\sthe\sos2Read()\sfunction\sto\sthose\sof\sother\splatforms\susing\scheckin\s(3549)\sto\sprevent\spossible\scorruption\s(CVS\s3617) +D 2007-01-28T21:12:13 F Makefile.in 7fa74bf4359aa899da5586e394d17735f221315f F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -77,7 +77,7 @@ F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/os.c 59f05de8c5777c34876607114a2fbe55ae578235 F src/os.h 17fc73165cb7436aa79492d2dff754baec74fcb9 F src/os_common.h 545426356f0868a6765e70cb59e319d3acad0ed6 -F src/os_os2.c 1ece434c4817e2925318954336cfe1731713beb0 +F src/os_os2.c 79df76be8122c88fd7f7b6baad6d648e7906f688 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 @@ -428,7 +428,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 4d0d2063df2191155b290dc426b502bc7e1959c7 -R a2972c8d5fa2fae3aaf367594ddfe702 -U drh -Z c458e87a08e33fa589eca60064bf3293 +P fc66070393b48f8022500c45e063068e801c05d7 +R fd8f3a50eb43815ad290d50ceebd0cd4 +U pweilbacher +Z 31c655a3b0ec171471e488960acc1029 diff --git a/manifest.uuid b/manifest.uuid index 7ca190f870..1df2c97cec 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fc66070393b48f8022500c45e063068e801c05d7 \ No newline at end of file +ba76107cd1fc1898f5357b20b339727e2e034e23 \ No newline at end of file diff --git a/src/os_os2.c b/src/os_os2.c index 0a008e1832..b127957c03 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -296,7 +296,14 @@ int os2Read( OsFile *id, void *pBuf, int amt ){ SimulateIOError( return SQLITE_IOERR ); TRACE3( "READ %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype ); DosRead( ((os2File*)id)->h, pBuf, amt, &got ); - return (got == (ULONG)amt) ? SQLITE_OK : SQLITE_IOERR_SHORT_READ; + if (got == (ULONG)amt) + return SQLITE_OK; + else if (got < 0) + return SQLITE_IOERR_READ; + else { + memset(&((char*)pBuf)[got], 0, amt-got); + return SQLITE_IOERR_SHORT_READ; + } } /* -- 2.47.2