Various fixes.

This commit is contained in:
Gregory Burd 2011-12-05 12:16:25 -05:00
parent 1f7ca0c189
commit d0c587bdec
4 changed files with 11 additions and 13 deletions

View file

@ -321,9 +321,8 @@ DRIVER_INIT(bdberl_drv)
// cleanup and set the environment to zero. Attempts to open ports will
// fail and the user will have to sort out how to resolve the issue.
DBG("G_DB_ENV->close(%p, 0);", &G_DB_ENV);
G_DB_ENV_ERROR = G_DB_ENV->close(G_DB_ENV, 0);
G_DB_ENV->close(G_DB_ENV, 0);
G_DB_ENV = 0;
DBG(" = %d\n", G_DB_ENV_ERROR);
}
}

View file

@ -378,7 +378,7 @@ void bdberl_tpool_thread_id(DB_ENV *env, pid_t *pid, db_threadid_t *tid)
char *bdberl_tpool_thread_id_string(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, char *buf)
{
snprintf(buf, DB_THREADID_STRLEN, "%d/%p", pid, tid);
snprintf(buf, DB_THREADID_STRLEN, "%d/%p", (unsigned int)pid, (void *)tid);
return buf;
}

View file

@ -2,7 +2,8 @@
cd $1/build_unix && \
../dist/configure --disable-shared --enable-static --with-pic \
--disable-heap --disable-queue \
--disable-partition --disable-replication \
--enable-o_direct \
--disable-heap --disable-queue --disable-replication \
--enable-o_direct --enable-o_direct \
--enable-debug --enable-diagnostics \
--enable-dtrace \
--prefix=$2

View file

@ -105,7 +105,7 @@
%% @spec open(Name, Type) -> {ok, Db} | {error, Error}
%% where
%% Name = string()
%% Type = btree | hash
%% Type = btree | hash | queue
%% Db = integer()
%%
%% @equiv open(Name, Type, [create])
@ -273,7 +273,7 @@ close(Db, Opts) ->
-spec txn_begin() -> ok | db_error().
txn_begin() ->
txn_begin([txn_snapshot]).
txn_begin([]).
%%--------------------------------------------------------------------
@ -596,7 +596,7 @@ transaction(Fun, Retries, TimeLeft, Opts) ->
transaction(Fun, R, T, Opts);
_ : Reason ->
lager:info("function threw non-lock error - ~p", [Reason]),
lager:info("function threw non-lock error - ~p", [{Reason, erlang:get_stacktrace()}]),
ok = txn_abort(),
{error, {transaction_failed, Reason}}
end;
@ -834,7 +834,7 @@ put_commit_r(Db, Key, Value, Opts) ->
%% @end
%%--------------------------------------------------------------------
-spec get(Db :: db(), Key :: db_key()) ->
not_found | {ok, db_ret_value()} | db_error().
not_found | {ok, db_ret_value()} | {error, db_error()}.
get(Db, Key) ->
get(Db, Key, []).
@ -885,7 +885,7 @@ get(Db, Key) ->
%% @end
%%--------------------------------------------------------------------
-spec get(Db :: db(), Key :: db_key(), Opts :: db_flags()) ->
not_found | {ok, db_ret_value()} | db_error().
not_found | {ok, db_ret_value()} | {error, db_error()}.
get(Db, Key, Opts) ->
{KeyLen, KeyBin} = to_binary(Key),
@ -964,8 +964,6 @@ get_r(Db, Key, Opts) ->
end.
%%--------------------------------------------------------------------
%% @doc
%% Delete a value based on key.