[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
+			}

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

[Home]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]

Add to Google Powered by Linux