summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-01-07 10:44:42 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-01-07 10:44:42 +1100
commitd9621cb4ba0d66f4b8a73a417dcc7b0635543c55 (patch)
treef4ca56e7814a29383fc8817eaef53b07840a9275 /examples
parent8bd16eb444612461d80d9fde93442ddacc39efd6 (diff)
parent24e8f4f9785af42e92743d8a308d990ddde224fb (diff)
downloadmongo-d9621cb4ba0d66f4b8a73a417dcc7b0635543c55.tar.gz
Merge pull request #1516 from wiredtiger/windows-errors
Windows error string support.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_all.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index 23e682c5072..31ad812e6f6 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -343,6 +343,22 @@ cursor_ops(WT_SESSION *session)
/*! [Display an error] */
}
+ {
+ /*! [Display an error thread safe] */
+ const char *key = "non-existent key";
+ cursor->set_key(cursor, key);
+ if ((ret = cursor->remove(cursor)) != 0) {
+ char buf[128];
+
+ if (wiredtiger_strerror_r(ret, buf, sizeof(buf)) != 0)
+ (void)snprintf(
+ buf, sizeof(buf), "error value: %d\n", ret);
+ fprintf(stderr, "cursor.remove: %s\n", buf);
+ return (ret);
+ }
+ /*! [Display an error thread safe] */
+ }
+
/*! [Close the cursor] */
ret = cursor->close(cursor);
/*! [Close the cursor] */