diff options
Diffstat (limited to 'src/third_party/wiredtiger/examples/c/ex_cursor.c')
-rw-r--r-- | src/third_party/wiredtiger/examples/c/ex_cursor.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_cursor.c b/src/third_party/wiredtiger/examples/c/ex_cursor.c index 67c945ebc0b..b8ed6ab169d 100644 --- a/src/third_party/wiredtiger/examples/c/ex_cursor.c +++ b/src/third_party/wiredtiger/examples/c/ex_cursor.c @@ -181,12 +181,12 @@ main(void) if ((ret = wiredtiger_open( home, NULL, "create,statistics=(fast)", &conn)) != 0) fprintf(stderr, "Error connecting to %s: %s\n", - home, wiredtiger_strerror(ret)); + home == NULL ? "." : home, wiredtiger_strerror(ret)); /* Open a session for the current thread's work. */ if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) fprintf(stderr, "Error opening a session on %s: %s\n", - home, wiredtiger_strerror(ret)); + home == NULL ? "." : home, wiredtiger_strerror(ret)); ret = session->create(session, "table:world", "key_format=r,value_format=5sii," @@ -220,9 +220,11 @@ main(void) ret = cursor->close(cursor); /* Note: closing the connection implicitly closes open session(s). */ - if ((ret = conn->close(conn, NULL)) != 0) + if ((ret = conn->close(conn, NULL)) != 0) { fprintf(stderr, "Error closing %s: %s\n", - home, wiredtiger_strerror(ret)); + home == NULL ? "." : home, wiredtiger_strerror(ret)); + return (EXIT_FAILURE); + } - return (ret); + return (EXIT_SUCCESS); } |