/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

292
293
294
295
296
297
298






299

300
301
302
303
304
305
306
*/
int os2Read( OsFile *id, void *pBuf, int amt ){
  ULONG got;
  assert( id!=0 );
  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;

}

/*
** Write data from a buffer into a file.  Return SQLITE_OK on success
** or some other error code on failure.
*/
int os2Write( OsFile *id, const void *pBuf, int amt ){







>
>
>
>
>
>
|
>







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
*/
int os2Read( OsFile *id, void *pBuf, int amt ){
  ULONG got;
  assert( id!=0 );
  SimulateIOError( return SQLITE_IOERR );
  TRACE3( "READ %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype );
  DosRead( ((os2File*)id)->h, pBuf, amt, &got );
  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;
  }
}

/*
** Write data from a buffer into a file.  Return SQLITE_OK on success
** or some other error code on failure.
*/
int os2Write( OsFile *id, const void *pBuf, int amt ){