diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2017-12-19 23:39:27 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2017-12-19 23:39:27 +0000 |
commit | 6abdfdead1326ccca98dc4cf415c216f1bf25400 (patch) | |
tree | 70b803bd499fd45e89627c1b45b90ddf20e8e959 /src/appconfig.c | |
parent | Release v. 1.8.0+dfsg-1 to Unstable (diff) | |
parent | New upstream version 1.9.0+dfsg (diff) | |
download | netdata-6abdfdead1326ccca98dc4cf415c216f1bf25400.tar.xz netdata-6abdfdead1326ccca98dc4cf415c216f1bf25400.zip |
Update upstream source from tag 'upstream/1.9.0+dfsg'
Update to upstream version '1.9.0+dfsg'
with Debian dir 28b8242a05f9ad26cd1cdbcf078be754fc7d6251
Diffstat (limited to 'src/appconfig.c')
-rw-r--r-- | src/appconfig.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/appconfig.c b/src/appconfig.c index 2c7721b8c..40cade818 100644 --- a/src/appconfig.c +++ b/src/appconfig.c @@ -567,6 +567,7 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) else pri = 2; if(i == pri) { + int loaded = 0; int used = 0; int changed = 0; int count = 0; @@ -574,13 +575,14 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) config_section_wrlock(co); for(cv = co->values; cv ; cv = cv->next) { used += (cv->flags & CONFIG_VALUE_USED)?1:0; + loaded += (cv->flags & CONFIG_VALUE_LOADED)?1:0; changed += (cv->flags & CONFIG_VALUE_CHANGED)?1:0; count++; } config_section_unlock(co); if(!count) continue; - if(only_changed && !changed) continue; + if(only_changed && !changed && !loaded) continue; if(!used) { buffer_sprintf(wb, "\n# section '%s' is not used.", co->name); @@ -594,7 +596,7 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) if(used && !(cv->flags & CONFIG_VALUE_USED)) { buffer_sprintf(wb, "\n\t# option '%s' is not used.\n", cv->name); } - buffer_sprintf(wb, "\t%s%s = %s\n", ((!(cv->flags & CONFIG_VALUE_CHANGED)) && (cv->flags & CONFIG_VALUE_USED))?"# ":"", cv->name, cv->value); + buffer_sprintf(wb, "\t%s%s = %s\n", ((!(cv->flags & CONFIG_VALUE_LOADED)) && (!(cv->flags & CONFIG_VALUE_CHANGED)) && (cv->flags & CONFIG_VALUE_USED))?"# ":"", cv->name, cv->value); } config_section_unlock(co); } |