Blob Blame History Raw
autofs-5.1.4 - tiny patch for autofs typo and possible bug

From: Todd Eigenschink <todd@fai2.com>

(1) The word "to" is doubled in two warnings.

(2) It prints a warning when it can't open the "old" config file, even
if it was able to open the default one. That's a reasonable warning if
it *couldn't* open the new one, but seems unnecessary if it could.

The patch removes the unneeded "to"s and only prints warning about the
old config file if it couldn't open the default one.

Signed-off-by: Todd Eigenschink <todd@fai2.com>
Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG      |    1 +
 lib/defaults.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -67,6 +67,7 @@
 - fix prefix option handling in expand_entry().
 - fix sublink option not set from defaults.
 - fix error return in do_nfs_mount().
+- tiny patch for autofs typo and possible bug.
 
 24/05/2017 autofs-5.1.3
 =======================
--- autofs-5.1.4.orig/lib/defaults.c
+++ autofs-5.1.4/lib/defaults.c
@@ -1207,12 +1207,12 @@ unsigned int defaults_read_config(unsign
 
 	conf = open_fopen_r(DEFAULT_CONFIG_FILE);
 	if (!conf)
-		message(to_syslog, "failed to to open config %s",
+		message(to_syslog, "failed to open config %s",
 			DEFAULT_CONFIG_FILE);
 
 	oldconf = open_fopen_r(OLD_CONFIG_FILE);
-	if (!oldconf)
-		message(to_syslog, "failed to to open old config %s",
+	if (!oldconf && !conf)
+		message(to_syslog, "failed to open old config %s",
 			OLD_CONFIG_FILE);
 
 	/* Neither config has been updated */