summaryrefslogtreecommitdiff
path: root/src/os/os_truncate.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /src/os/os_truncate.c
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'src/os/os_truncate.c')
-rw-r--r--src/os/os_truncate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/os/os_truncate.c b/src/os/os_truncate.c
index f559e9cb..473db9cc 100644
--- a/src/os/os_truncate.c
+++ b/src/os/os_truncate.c
@@ -1,7 +1,7 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 2004, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
@@ -14,14 +14,16 @@
* __os_truncate --
* Truncate the file.
*
- * PUBLIC: int __os_truncate __P((ENV *, DB_FH *, db_pgno_t, u_int32_t));
+ * PUBLIC: int __os_truncate
+ * PUBLIC: __P((ENV *, DB_FH *, db_pgno_t, u_int32_t, off_t));
*/
int
-__os_truncate(env, fhp, pgno, pgsize)
+__os_truncate(env, fhp, pgno, pgsize, relative)
ENV *env;
DB_FH *fhp;
db_pgno_t pgno;
u_int32_t pgsize;
+ off_t relative;
{
DB_ENV *dbenv;
off_t offset;
@@ -33,7 +35,7 @@ __os_truncate(env, fhp, pgno, pgsize)
* Truncate a file so that "pgno" is discarded from the end of the
* file.
*/
- offset = (off_t)pgsize * pgno;
+ offset = (off_t)pgsize * pgno + relative;
if (dbenv != NULL &&
FLD_ISSET(dbenv->verbose, DB_VERB_FILEOPS | DB_VERB_FILEOPS_ALL))