diff mbox series

[nfs-utils] conffile: Don't give warning for optional config files.

Message ID 87imiq7586.fsf@notabene.neil.brown.name (mailing list archive)
State New, archived
Headers show
Series [nfs-utils] conffile: Don't give warning for optional config files. | expand

Commit Message

NeilBrown March 27, 2020, 5:10 a.m. UTC
A recent commit added the possibility of optional config files for which
warning messages would be suppressed.
Unfortunately only one of the possible warning messages - the least
likely one - was suppressed.

This patch suppresses the other.

Fixes: c6fdcbe0a5cf ("conffile: allow optional include files")
Signed-off-by: NeilBrown <neilb@suse.de>
---
 support/nfs/conffile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


That was careless - sorry.  I really have tested this time.
NeilBrown

Comments

Steve Dickson March 27, 2020, 7:16 p.m. UTC | #1
On 3/27/20 1:10 AM, NeilBrown wrote:
> 
> A recent commit added the possibility of optional config files for which
> warning messages would be suppressed.
> Unfortunately only one of the possible warning messages - the least
> likely one - was suppressed.
> 
> This patch suppresses the other.
> 
> Fixes: c6fdcbe0a5cf ("conffile: allow optional include files")
> Signed-off-by: NeilBrown <neilb@suse.de>
Committed... (tag: nfs-utils-2-4-4-rc2)

steved.
> ---
>  support/nfs/conffile.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 
> That was careless - sorry.  I really have tested this time.
> NeilBrown
> 
> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
> index d55bfe10120a..3d13610ee766 100644
> --- a/support/nfs/conffile.c
> +++ b/support/nfs/conffile.c
> @@ -429,9 +429,9 @@ conf_parse_line(int trans, char *line, const char *filename, int lineno, char **
>  
>  		subconf = conf_readfile(relpath);
>  		if (subconf == NULL) {
> -			xlog_warn("config error at %s:%d: "
> -				"error loading included config",
> -				  filename, lineno);
> +			if (!optional)
> +				xlog_warn("config error at %s:%d: error loading included config",
> +					  filename, lineno);
>  			if (relpath)
>  				free(relpath);
>  			return;
>
diff mbox series

Patch

diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index d55bfe10120a..3d13610ee766 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -429,9 +429,9 @@  conf_parse_line(int trans, char *line, const char *filename, int lineno, char **
 
 		subconf = conf_readfile(relpath);
 		if (subconf == NULL) {
-			xlog_warn("config error at %s:%d: "
-				"error loading included config",
-				  filename, lineno);
+			if (!optional)
+				xlog_warn("config error at %s:%d: error loading included config",
+					  filename, lineno);
 			if (relpath)
 				free(relpath);
 			return;