diff options
author | Michael Adam <obnox@samba.org> | 2011-10-06 20:34:55 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:58 +0200 |
commit | 603c3e1bcb7b4106afe4aefdfed43e7832ede956 (patch) | |
tree | 3bbd74811e5a62786975aada7399931db36d1549 /source3/utils | |
parent | ce8626cbbe99b26f4e39ace87221792b468b9c93 (diff) | |
download | samba-603c3e1bcb7b4106afe4aefdfed43e7832ede956.tar.gz samba-603c3e1bcb7b4106afe4aefdfed43e7832ede956.tar.bz2 samba-603c3e1bcb7b4106afe4aefdfed43e7832ede956.zip |
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.
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/dbwrap_tool.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |