[PATCH 10/14] depmod: store module_dir without trailing slash

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

This matches the way it may be written in alternatives files.

Signed-off-by: Keegan McAllister <keegan@xxxxxxxxxxx>
 depmod.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/depmod.c b/depmod.c
index 14da871..beb65d8 100644
--- a/depmod.c
+++ b/depmod.c
@@ -35,7 +35,7 @@
 #include "testing.h"
 #ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules/"
+#define MODULE_DIR "/lib/modules"
@@ -1232,7 +1232,7 @@ static int parse_config_file(const char *filename,
 							     0, *search);
-				nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
+				nofail_asprintf(&dirname, "%s%s/%s/%s", basedir,
 					module_dir, kernelversion, search_path);
 				len = strlen(dirname);
 				*search = add_search(dirname, len, *search);
@@ -1247,7 +1247,7 @@ static int parse_config_file(const char *filename,
 			if (!regex_match(kernelversion, (const char *)version))
-			nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
+			nofail_asprintf(&pathname, "%s%s/%s/%s/%s.ko", basedir,
 				module_dir, kernelversion, subdir, modname);
 			*overrides = add_override(pathname, *overrides);
@@ -1473,7 +1473,7 @@ static void do_alternative(struct config_alternative *alt,
-	nofail_asprintf(&dirname, "%s%s%s", basedir, alt->module_dir, version);
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, alt->module_dir, version);
 	if (maybe_all) {
 		if (!doing_stdout && !depfile_out_of_date(dirname))
@@ -1491,7 +1491,7 @@ static void do_alternative(struct config_alternative *alt,
 		char *dirname;
 		size_t len;
-		nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
+		nofail_asprintf(&dirname, "%s%s/%s/updates", basedir,
 				alt->module_dir, version);
 		len = strlen(dirname);
 		search = add_search(dirname, len, search);

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