summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-05-11 10:56:09 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-05-11 10:56:09 +0000
commitff12749de3376be6c04a835b57cbb803fed9967e (patch)
tree5276ec18a2e1c844018c2937635ba183c2f25360 /examples
parent5a06143447e57a428aa85cd6fbb9c982831dcdb0 (diff)
downloadmongo-ff12749de3376be6c04a835b57cbb803fed9967e.tar.gz
The wiredtiger_struct_size() call can fail, it has to return an error
status, not a size.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_all.c4
-rw-r--r--examples/c/ex_pack.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index bdbca774d18..79ff1fc8c0b 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -695,9 +695,9 @@ pack_ops(WT_SESSION *session)
{
/*! [Get the packed size] */
size_t size;
- size = wiredtiger_struct_size(session, "iSh", 42, "hello", -3);
- assert(size < 100);
+ ret = wiredtiger_struct_size(session, &size, "iSh", 42, "hello", -3);
/*! [Get the packed size] */
+ assert(size < 100);
}
{
diff --git a/examples/c/ex_pack.c b/examples/c/ex_pack.c
index e55e82d482c..272c8b745de 100644
--- a/examples/c/ex_pack.c
+++ b/examples/c/ex_pack.c
@@ -54,12 +54,14 @@ int main(void)
home, wiredtiger_strerror(ret));
/*! [packing] */
- size = wiredtiger_struct_size(session, "iii", 42, 1000, -9);
+ ret = wiredtiger_struct_size(session, &size, "iii", 42, 1000, -9);
if (size > sizeof(buf)) {
/* Allocate a bigger buffer. */
}
- wiredtiger_struct_pack(session, buf, size, "iii", 42, 1000, -9);
- wiredtiger_struct_unpack(session, buf, size, "iii", &i, &j, &k);
+
+ ret = wiredtiger_struct_pack(session, buf, size, "iii", 42, 1000, -9);
+
+ ret = wiredtiger_struct_unpack(session, buf, size, "iii", &i, &j, &k);
/*! [packing] */
/* Note: closing the connection implicitly closes open session(s). */