diff options
author | David Hows <howsdav@gmail.com> | 2015-12-23 15:38:52 +1100 |
---|---|---|
committer | David Hows <howsdav@gmail.com> | 2015-12-23 15:43:30 +1100 |
commit | f91368e4053bab480da3ca2ff8b334e19380d168 (patch) | |
tree | 0d2113e9e362d9a09feb2f0da1bc59586c992b59 | |
parent | 4c5ae9ffc2ad3b9e18963623c2c534b9699ebb0f (diff) | |
download | mongo-f91368e4053bab480da3ca2ff8b334e19380d168.tar.gz |
WT-2304 - Clone the config queue into all database config copies
-rw-r--r-- | bench/wtperf/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c index 7038600cd94..2177fc92b92 100644 --- a/bench/wtperf/config.c +++ b/bench/wtperf/config.c @@ -54,6 +54,7 @@ static void config_opt_usage(void); int config_assign(CONFIG *dest, const CONFIG *src) { + CONFIG_QUEUE_ENTRY *conf_line, *tmp_line; size_t i, len; char *newstr, **pstr; @@ -97,6 +98,17 @@ config_assign(CONFIG *dest, const CONFIG *src) TAILQ_INIT(&dest->stone_head); TAILQ_INIT(&dest->config_head); + + /* Clone the config string information into the new cfg object */ + conf_line = TAILQ_FIRST(&src->config_head); + while (conf_line != NULL) { + len = strlen(conf_line->string); + tmp_line = calloc(sizeof(CONFIG_QUEUE_ENTRY),1); + tmp_line->string = calloc(len + 1, 1); + strncpy(tmp_line->string, conf_line->string, len); + TAILQ_INSERT_TAIL(&dest->config_head, tmp_line, c); + conf_line = TAILQ_NEXT(conf_line, c); + } return (0); } |