summaryrefslogtreecommitdiffstats
path: root/utils/osmo-config-merge.c
Commit message (Collapse)AuthorAgeFilesLines
* osmo-config-merge: fclose() what we fopen()Harald Welte2018-10-211-0/+2
| | | | | Change-Id: Ib44f902e5bca2277f1b340d34fabbd2a298d683e Fixes: Coverity CID#188851
* osmo-config-merge: Fix some small issuesDaniel Willmann2018-09-281-4/+15
| | | | | | | | | Allocate NULL context after exit_usage() calls and free it before exit so * sanitizer is happy. Also handle the error cases gracefully when a file is unreadable or formatted wrong. Change-Id: I966e63a3f7d0ff71ee0b88922aa3807d073aa232
* utils/osmo-config-merge: explicitly return from main()Vadim Yanitskiy2018-09-271-0/+2
| | | | | | | | | | | | This change fixes the following compiler warning: osmo-config-merge.c: In function ‘main’: osmo-config-merge.c:268:1: warning: control reaches end of non-void function [-Wreturn-type] Despite it isn't critical, let's get rid of this warning. Change-Id: I7a80a85c8b3180dc086cd9fd20356aab16ea8100
* osmo-config-merge: Don't use C99 'for' loop initial declarationsHarald Welte2018-09-251-2/+4
| | | | | | | | | | | | | The existing code passed gerrit build verification but failed the master builds with the following error: osmo-config-merge.c:148:4: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < cur_indent - indent; i++) { ^ osmo-config-merge.c:148:4: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code Change-Id: Ia29e85b648c1a427be88242306634efe890e250d
* Add new osmo-config-merge utilityHarald Welte2018-09-251-0/+266
This utility allows you to merge an incremental config "patch" into an osmocom-style config file. The patch file follows the same syntax as the original config file. It works by appending the leaf nodes of the patch file to the respective nodes of the input config file. This process allows configuration file changes/updates to be performed in a more stable/reliable way than by means of [unified] diff files, as they break every time the context lines break. osmo-config-merge doesn't suffer from this problem, as it understands the tree-like nature of VTY config files. NITE: This only works with configuration files that have proper indenting, i.e. every level in the hierarchy must be indented excatly one character, not multiple. Change-Id: I61997a3668cc3a40d12ca023272f6d782e6fbefe