From de35749bba759449cc9c972d0345b18a3ca7acbb Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Tue, 28 Oct 2008 03:03:14 +0000 Subject: fix dry running. --- utility/logparse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utility/logparse.c b/utility/logparse.c index afb1824..67f51b6 100644 --- a/utility/logparse.c +++ b/utility/logparse.c @@ -361,7 +361,7 @@ apr_status_t parser_parsefile(config_t *cfg, config_filestat_t *fstat) fstat->linesparsed = 0; // Start Transaction fstat->start = apr_time_now(); - if (database_trans_start(cfg,tp)) { + if (!cfg->dryrun && database_trans_start(cfg,tp)) { fstat->result = "Database Transaction Error"; fstat->stop = apr_time_now(); return rv; @@ -405,7 +405,7 @@ apr_status_t parser_parsefile(config_t *cfg, config_filestat_t *fstat) rv = parser_processline(targp, cfg, fstat, targv, targc); if (rv != APR_SUCCESS) { int i; - database_trans_abort(cfg); + if (!cfg->dryrun) database_trans_abort(cfg); logging_log(cfg, LOGLEVEL_ERROR, "Line %d(%d): %s", fstat->linesparsed, targc, buff); for (i = 0; targv[i]; i++) { @@ -420,7 +420,7 @@ apr_status_t parser_parsefile(config_t *cfg, config_filestat_t *fstat) } while (rv == APR_SUCCESS); apr_file_close(file); // Finish Transaction - if (database_trans_stop(cfg,tp)) { + if (!cfg->dryrun && database_trans_stop(cfg,tp)) { fstat->result = apr_psprintf(cfg->pool, "Input line %d, Database Transaction Error", fstat->linesparsed); -- cgit