diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-01-07 10:44:42 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-01-07 10:44:42 +1100 |
commit | d9621cb4ba0d66f4b8a73a417dcc7b0635543c55 (patch) | |
tree | f4ca56e7814a29383fc8817eaef53b07840a9275 /examples | |
parent | 8bd16eb444612461d80d9fde93442ddacc39efd6 (diff) | |
parent | 24e8f4f9785af42e92743d8a308d990ddde224fb (diff) | |
download | mongo-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.c | 16 |
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] */ |