/ Check-in [0b20a696]
Login

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

Overview
Comment:Cast the 2nd parameter of ftruncate to off_t to work around bugs in some unix implementations. Ticket #2425. (CVS 4089)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0b20a69609c64af922bedab381f7d075e9da4fc5
User & Date: drh 2007-06-19 10:50:38
Context
2007-06-19
10:58
Do not segfault even if sqlite is misused by requesting query results after the query has been reset. ticket #2426. (CVS 4090) check-in: 783f19be user: drh tags: trunk
10:50
Cast the 2nd parameter of ftruncate to off_t to work around bugs in some unix implementations. Ticket #2425. (CVS 4089) check-in: 0b20a696 user: drh tags: trunk
2007-06-18
17:44
Another attempt to fix the build process for TCL windows bindings. (CVS 4088) check-in: 1fd2a358 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281

/*
** Truncate an open file to a specified size
*/
static int unixTruncate(OsFile *id, i64 nByte){
  int rc;
  assert( id );
  rc = ftruncate(((unixFile*)id)->h, nByte);
  SimulateIOError( rc=1 );
  if( rc ){
    return SQLITE_IOERR_TRUNCATE;
  }else{
    return SQLITE_OK;
  }
}







|







1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281

/*
** Truncate an open file to a specified size
*/
static int unixTruncate(OsFile *id, i64 nByte){
  int rc;
  assert( id );
  rc = ftruncate(((unixFile*)id)->h, (off_t)nByte);
  SimulateIOError( rc=1 );
  if( rc ){
    return SQLITE_IOERR_TRUNCATE;
  }else{
    return SQLITE_OK;
  }
}