diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-02-18 13:48:58 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-02-18 13:48:58 +1100 |
commit | 84c66e709b9ff0d4f993fc231c507034e6e9220a (patch) | |
tree | 2a3294f17619b098efebde251933742c87f8e146 /examples | |
parent | 6ad817ec5df8131a642bf79c3bb79a6bc6d0aa8a (diff) | |
parent | d5131a90497c19f13d01384cb050a339ab1753c7 (diff) | |
download | mongo-84c66e709b9ff0d4f993fc231c507034e6e9220a.tar.gz |
Merge pull request #1629 from wiredtiger/session-strerror
WT_SESSION.strerror
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/ex_all.c | 8 | ||||
-rw-r--r-- | examples/c/ex_data_source.c | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index 51b4bb42040..51c63e307c6 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -357,12 +357,8 @@ cursor_ops(WT_SESSION *session) 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); + fprintf(stderr, + "cursor.remove: %s\n", session->strerror(session, ret)); return (ret); } /*! [Display an error thread safe] */ diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c index 5043fa1b67d..7fb400b5922 100644 --- a/examples/c/ex_data_source.c +++ b/examples/c/ex_data_source.c @@ -75,8 +75,9 @@ my_create(WT_DATA_SOURCE *dsrc, WT_SESSION *session, { int ret = 0; /*! [WT_EXTENSION_API strerror] */ - (void)wt_api->err_printf(wt_api, - session, "WiredTiger error return: %s", wt_api->strerror(ret)); + (void)wt_api->err_printf(wt_api, session, + "WiredTiger error return: %s", + wt_api->strerror(wt_api, session, ret)); /*! [WT_EXTENSION_API strerror] */ } |