From 603c3e1bcb7b4106afe4aefdfed43e7832ede956 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Oct 2011 20:34:55 +0200 Subject: s3:dbwrap: convert dbwrap_fetch_int32() to NTSTATUS return code Return the int32 value retrieved from the db by reference. Before this, return value "-1" was used as a error indication, but it could also be a valid value from the database. --- source3/utils/dbwrap_tool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c index d6aea126b8..33ef94f6b9 100644 --- a/source3/utils/dbwrap_tool.c +++ b/source3/utils/dbwrap_tool.c @@ -35,8 +35,14 @@ static int dbwrap_tool_fetch_int32(struct db_context *db, void *data) { int32_t value; + NTSTATUS status; - value = dbwrap_fetch_int32(db, keyname); + status = dbwrap_fetch_int32(db, keyname, &value); + if (!NT_STATUS_IS_OK(status)) { + d_printf("Error fetching int32 from key '%s': %s\n", + keyname, nt_errstr(status)); + return -1; + } d_printf("%d\n", value); return 0; -- cgit