kmodloader: respect global directory prefix in scan_module_folder()
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 14 Oct 2013 14:13:40 +0000 (14:13 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 14 Oct 2013 14:13:40 +0000 (14:13 +0000)
kmodloader.c

index 623a169..11af0ae 100644 (file)
@@ -284,8 +284,8 @@ static int scan_module_folder(void)
        int j;
 
        uname(&ver);
        int j;
 
        uname(&ver);
-       path = alloca(sizeof(DEF_MOD_PATH "*.ko") + strlen(ver.release) + 1);
-       sprintf(path, DEF_MOD_PATH "*.ko", ver.release);
+       path = alloca(sizeof(DEF_MOD_PATH "*.ko") + strlen(prefix) + strlen(ver.release) + 1);
+       sprintf(path, "%s" DEF_MOD_PATH "*.ko", prefix, ver.release);
 
        if (glob(path, gl_flags, NULL, &gl) < 0)
                return -1;
 
        if (glob(path, gl_flags, NULL, &gl) < 0)
                return -1;