diff options
author | Keith Bostic <keith.bostic@wiredtiger.com> | 2011-10-12 20:30:11 +0000 |
---|---|---|
committer | Keith Bostic <keith.bostic@wiredtiger.com> | 2011-10-12 20:30:11 +0000 |
commit | 8f62232c44e933ee6d65a3e2dc441cb60de1a015 (patch) | |
tree | 54ac04445d2bdb0d5fe9d60270bf7e43b2121b3a /src/utilities/util_dump.c | |
parent | a33c7df80d987f6231b24a5c021aa12d97add08b (diff) | |
download | mongo-8f62232c44e933ee6d65a3e2dc441cb60de1a015.tar.gz |
Add the -n option to load (rename the object), and replace [-c config]
with uri/configuration-string pairs that modify object's configurations.
Diffstat (limited to 'src/utilities/util_dump.c')
-rw-r--r-- | src/utilities/util_dump.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c index 988f2a56ee8..e01d57fa655 100644 --- a/src/utilities/util_dump.c +++ b/src/utilities/util_dump.c @@ -12,7 +12,6 @@ static int cursor_err(const char *, const char *, int); static int schema(WT_SESSION *, const char *); static int schema_file(WT_CURSOR *, const char *); static int schema_table(WT_CURSOR *, const char *); -static int sys_err(void); static int usage(void); static inline int @@ -27,7 +26,7 @@ dump_forward(WT_CURSOR *cursor, const char *name) if ((ret = cursor->get_value(cursor, &value)) != 0) return (cursor_err(name, "get_value", ret)); if (printf("%s\n%s\n", key, value) < 0) - return (sys_err()); + return (util_syserr()); } return (ret == WT_NOTFOUND ? 0 : cursor_err(name, "next", ret)); } @@ -44,7 +43,7 @@ dump_reverse(WT_CURSOR *cursor, const char *name) if ((ret = cursor->get_value(cursor, &value)) != 0) return (cursor_err(name, "get_value", ret)); if (printf("%s\n%s\n", key, value) < 0) - return (sys_err()); + return (util_syserr()); } return (ret == WT_NOTFOUND ? 0 : cursor_err(name, "prev", ret)); } @@ -179,7 +178,7 @@ schema_table(WT_CURSOR *cursor, const char *uri) if ((ret = cursor->get_key(cursor, &key)) != 0) return (cursor_err(uri, "get_key", ret)); if ((buf = strdup(key)) == NULL) - return (sys_err()); + return (util_syserr()); /* Check for the dump table's column groups or indices. */ if ((p = strchr(buf, ':')) == NULL) @@ -198,11 +197,11 @@ schema_table(WT_CURSOR *cursor, const char *uri) return (cursor_err(uri, "get_value", ret)); if (elem == list_elem && (list = realloc(list, (size_t)(list_elem += 20) * sizeof(*list))) == NULL) - return (sys_err()); + return (util_syserr()); if ((list[elem].key = strdup(key)) == NULL) - return (sys_err()); + return (util_syserr()); if ((list[elem].value = strdup(value)) == NULL) - return (sys_err()); + return (util_syserr()); ++elem; } if (ret != WT_NOTFOUND) @@ -304,13 +303,6 @@ cursor_err(const char *name, const char *op, int ret) } static int -sys_err(void) -{ - fprintf(stderr, "%s: %s\n", progname, wiredtiger_strerror(errno)); - return (1); -} - -static int usage(void) { (void)fprintf(stderr, |