/ Check-in [ba76107c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adapt returns of the os2Read() function to those of other platforms using checkin (3549) to prevent possible corruption (CVS 3617)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ba76107cd1fc1898f5357b20b339727e2e034e23
User & Date: pweilbacher 2007-01-28 21:12:13
Context
2007-01-28
21:42
Implement the platform specific part of the shared library interface on OS/2 (CVS 3618) check-in: 027251a6 user: pweilbacher tags: trunk
21:12
Adapt returns of the os2Read() function to those of other platforms using checkin (3549) to prevent possible corruption (CVS 3617) check-in: ba76107c user: pweilbacher tags: trunk
2007-01-27
14:30
Version 3.3.12 (CVS 3616) check-in: fc660703 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

   292    292   */
   293    293   int os2Read( OsFile *id, void *pBuf, int amt ){
   294    294     ULONG got;
   295    295     assert( id!=0 );
   296    296     SimulateIOError( return SQLITE_IOERR );
   297    297     TRACE3( "READ %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype );
   298    298     DosRead( ((os2File*)id)->h, pBuf, amt, &got );
   299         -  return (got == (ULONG)amt) ? SQLITE_OK : SQLITE_IOERR_SHORT_READ;
          299  +  if (got == (ULONG)amt)
          300  +    return SQLITE_OK;
          301  +  else if (got < 0)
          302  +    return SQLITE_IOERR_READ;
          303  +  else {
          304  +    memset(&((char*)pBuf)[got], 0, amt-got);
          305  +    return SQLITE_IOERR_SHORT_READ;
          306  +  }
   300    307   }
   301    308   
   302    309   /*
   303    310   ** Write data from a buffer into a file.  Return SQLITE_OK on success
   304    311   ** or some other error code on failure.
   305    312   */
   306    313   int os2Write( OsFile *id, const void *pBuf, int amt ){