summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2014-11-18 12:35:27 -0500
committerSusan LoVerso <sue@wiredtiger.com>2014-11-18 12:35:27 -0500
commit7f968a259bf9cf54b75ff4d190aea0956cc01659 (patch)
treec32a2fe2cf4c98c1aea262f1d592e361391b0201 /examples
parentc692cf0a366de9a7d68cc5c654655fd10b864779 (diff)
downloadmongo-7f968a259bf9cf54b75ff4d190aea0956cc01659.tar.gz
Review comments. #1183
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_backup.c18
-rw-r--r--examples/c/ex_log.c2
2 files changed, 12 insertions, 8 deletions
diff --git a/examples/c/ex_backup.c b/examples/c/ex_backup.c
index c3e09add703..cccf5459234 100644
--- a/examples/c/ex_backup.c
+++ b/examples/c/ex_backup.c
@@ -24,8 +24,8 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
- * ex_log.c
- * demonstrates how to logging and log cursors.
+ * ex_backup.c
+ * demonstrates how to use incremental backup and log files.
*/
#include <inttypes.h>
#include <stdio.h>
@@ -58,7 +58,7 @@ static int
compare_backups(WT_SESSION *session, int i)
{
int ret;
- char buf[1024];
+ char buf[1024], msg[8];
/*
* We run 'wt dump' on both the full backup directory and the
@@ -92,14 +92,18 @@ compare_backups(WT_SESSION *session, int i)
(void)snprintf(buf, sizeof(buf), "cmp %s.%d %s.%d",
full_out, i, incr_out, i);
ret = system(buf);
+ if (i == 0)
+ (void)strncpy(msg, "MAIN", sizeof(msg));
+ else
+ snprintf(msg, sizeof(msg), "%d", i);
if (ret == 0)
fprintf(stdout,
- "Iteration %d: Tables %s.%d and %s.%d identical\n",
- i, full_out, i, incr_out, i);
+ "Iteration %s: Tables %s.%d and %s.%d identical\n",
+ msg, full_out, i, incr_out, i);
else {
fprintf(stdout,
- "Iteration %d: Tables %s.%d and %s.%d differ\n",
- i, full_out, i, incr_out, i);
+ "Iteration %s: Tables %s.%d and %s.%d differ\n",
+ msg, full_out, i, incr_out, i);
exit(1);
}
diff --git a/examples/c/ex_log.c b/examples/c/ex_log.c
index 8ac7d079da1..c58c8997c66 100644
--- a/examples/c/ex_log.c
+++ b/examples/c/ex_log.c
@@ -25,7 +25,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*
* ex_log.c
- * demonstrates how to logging and log cursors.
+ * demonstrates how to use logging and log cursors.
*/
#include <inttypes.h>
#include <stdio.h>