[PATCH 03/14] modprobe: ignore broken symlink config files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows transient module changes to be implemented by symlinks to tmpfs.
With '-v' a warning is printed.

The special-casing of ENOENT is similar to code already in depmod.c.

Signed-off-by: Keegan McAllister <keegan@xxxxxxxxxxx>
---
 modprobe.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modprobe.c b/modprobe.c
index 0823c8d..7b3b44a 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -1104,9 +1104,15 @@ static int parse_config_scan(const char *filename,
 
 			nofail_asprintf(&cfgfile, "%s/%s", filename, fe->name);
 			if (!parse_config_file(cfgfile, conf,
-					       dump_only, removing))
-				warn("Failed to open config file "
-				     "%s: %s\n", fe->name, strerror(errno));
+					       dump_only, removing)) {
+				if (errno != ENOENT)
+					warn("Failed to open config file "
+					     "%s: %s\n", fe->name, strerror(errno));
+				else if (verbose)
+					warn("Config file does not actually exist (broken symlink?): "
+					     "%s\n", fe->name);
+				// else no warning
+			}
 			free(cfgfile);
 			list_del(&fe->node);
 			free(fe);
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux