summaryrefslogtreecommitdiff
path: root/build_vxworks/util/db_tuner.c
diff options
context:
space:
mode:
Diffstat (limited to 'build_vxworks/util/db_tuner.c')
-rw-r--r--build_vxworks/util/db_tuner.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/build_vxworks/util/db_tuner.c b/build_vxworks/util/db_tuner.c
index e78f04a7..9a8bf442 100644
--- a/build_vxworks/util/db_tuner.c
+++ b/build_vxworks/util/db_tuner.c
@@ -1,7 +1,7 @@
/*
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*
@@ -54,7 +54,7 @@
#ifndef lint
static const char copyright[] =
- "Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.\n";
+ "Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.\n";
#endif
/*
@@ -123,8 +123,8 @@ static int db_tuner___tuner_record_leaf_pg __P((int, TUNER_FF_STAT *));
static int db_tuner___tuner_record_ovfl_pg __P((u_int32_t, int, TUNER_FF_STAT *));
static int db_tuner_get_opd_size __P((DBC*, PAGE*, u_int32_t*));
-static int db_tuner_item_size __P((DB *, PAGE *, db_indx_t));
-static int db_tuner_item_space __P((DB *, PAGE *, db_indx_t));
+static int db_tuner_item_size __P((DB *, PAGE *, int));
+static int db_tuner_item_space __P((DB *, PAGE *, int));
int db_tuner_main __P((int, char *[]));
static int db_tuner_open_db __P((DB **, DB_ENV *, char *, char *));
static int db_tuner_sum_opd_page_data_entries __P((DB *, PAGE *));
@@ -153,6 +153,7 @@ db_tuner_main(argc, argv)
char *argv[];
{
extern char *optarg;
+ extern int optind, __db_getopt_reset;
DB *dbp;
DB_ENV *dbenv;
DBTYPE dbtype;
@@ -192,6 +193,8 @@ db_tuner_main(argc, argv)
default:
db_tuner_usage();
}
+ argc -= optind;
+ argv += optind;
/* Handle possible interruptions. */
__db_util_siginit();
@@ -219,7 +222,8 @@ db_tuner_main(argc, argv)
* private one and try again.
*/
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
- (ret == DB_VERSION_MISMATCH || (ret = dbenv->open(dbenv, home,
+ (ret == DB_VERSION_MISMATCH || ret == DB_REP_LOCKOUT ||
+ (ret = dbenv->open(dbenv, home,
DB_CREATE | DB_INIT_MPOOL | DB_USE_ENVIRON | DB_PRIVATE,
0)) != 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open:");
@@ -681,7 +685,6 @@ db_tuner___tuner_opd_data(dbc, h, indx_pgsz, is_opd, cookie)
DB_MPOOLFILE *mpf;
PAGE *p;
db_pgno_t next_pgno;
- u_int32_t pgsize;
int ret;
dbp = dbc->dbp;
@@ -689,7 +692,6 @@ db_tuner___tuner_opd_data(dbc, h, indx_pgsz, is_opd, cookie)
mpf = dbp->mpf;
p = h;
- pgsize = (1 << indx_pgsz) * DB_MIN_PGSIZE;
/*
* __tuner_leaf_page has inserted one key for each opd already,
@@ -1126,7 +1128,7 @@ static int
db_tuner_item_space(dbp, h, indx)
DB *dbp;
PAGE *h;
- db_indx_t indx;
+ int indx;
{
return (B_TYPE(GET_BKEYDATA(dbp, h, indx)->type) == B_KEYDATA ?
BKEYDATA_PSIZE(GET_BKEYDATA(dbp, h, indx)->len) :
@@ -1138,7 +1140,7 @@ static int
db_tuner_item_size(dbp, h, indx)
DB *dbp;
PAGE *h;
- db_indx_t indx;
+ int indx;
{
return (B_TYPE(GET_BKEYDATA(dbp, h, indx)->type) == B_KEYDATA ?
GET_BKEYDATA(dbp, h, indx)->len : GET_BOVERFLOW(dbp, h,