[PATCH 2/2] tdb: Improve the documentation of tdb_reopen() and tdb_close().
simo
idra at samba.org
Tue Dec 11 09:18:42 MST 2012
On Tue, 2012-12-11 at 17:12 +0100, Andreas Schneider wrote:
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
> lib/tdb/include/tdb.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
> index d19439e..e371e33 100644
> --- a/lib/tdb/include/tdb.h
> +++ b/lib/tdb/include/tdb.h
> @@ -212,9 +212,12 @@ void tdb_set_max_dead(struct tdb_context *tdb, int max_dead);
> * This can be used after a fork to ensure that we have an independent seek
> * pointer from our parent and to re-establish locks.
> *
> - * @param[in] tdb The database to reopen.
> + * @param[in] tdb The database to reopen. It will be free'd on error!
> *
> * @return 0 on success, -1 on error.
> + *
> + * @note Don't call tdb_error() after this function cause the tdb context will
> + * be freed on error.
> */
> int tdb_reopen(struct tdb_context *tdb);
>
> @@ -361,9 +364,12 @@ int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf);
> /**
> * @brief Close a database.
> *
> - * @param[in] tdb The database to close.
> + * @param[in] tdb The database to close. The context will be free'd.
> *
> * @return 0 for success, -1 on error.
> + *
> + * @note Don't call tdb_error() after this function cause the tdb context will
> + * be freed on error.
> */
> int tdb_close(struct tdb_context *tdb);
>
Reviewed-by: Simo Sorce <idra at samba.org>
Simo.
--
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>
More information about the samba-technical
mailing list