diff options
author | Michael Larson <mike@vyatta.com> | 2010-11-16 15:30:49 -0800 |
---|---|---|
committer | Michael Larson <mike@vyatta.com> | 2010-11-16 15:30:49 -0800 |
commit | 8c55b0bd88227949ee63c88acb6c001089b3954e (patch) | |
tree | 9b55006e85792a829edcac158a43f0d158615673 /src | |
parent | be4e447f13091a35ec2fda8a1f540b0fc1db8c81 (diff) | |
download | vyatta-cfg-8c55b0bd88227949ee63c88acb6c001089b3954e.tar.gz vyatta-cfg-8c55b0bd88227949ee63c88acb6c001089b3954e.zip |
allow error location to be set via environmental variable. update commit check to preserve key when flag is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/commit2.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/commit2.c b/src/commit2.c index 92f37ed..6d2270d 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -192,6 +192,12 @@ main(int argc, char** argv) } } + //can also be set via environment variable + if (getenv("VYATTA_OUTPUT_ERROR_LOCATION") != NULL) { + g_print_error_location_all = TRUE; + } + + initialize_output("Commit"); init_paths(TRUE); if (g_debug) { @@ -1474,7 +1480,12 @@ validate_func(GNode *node, gpointer data) } char *p = clind_unescape(path_buf); if (strlen(outbuf) > 0) { - fprintf(out_stream,"[ %s ] \n %s\n",p,outbuf); + if (g_print_error_location_all == TRUE) { + fprintf(out_stream,"_errloc_:[ %s ] \n %s\n",p,outbuf); + } + else { + fprintf(out_stream,"[ %s ] \n %s\n",p,outbuf); + } } syslog(LOG_ERR,"commit error for %s:[%s]\n",ActionNames[result->_action],d->_path); if (g_display_error_node) { |