validate: add missing yes/no boolean values
[project/ubox.git] / kmodloader.c
index db4574e..633570f 100644 (file)
@@ -420,7 +420,7 @@ static int insert_module(char *path, const char *options)
 
        data = malloc(s.st_size);
        if (read(fd, data, s.st_size) == s.st_size)
-               ret = syscall(__NR_init_module, data, s.st_size, options);
+               ret = syscall(__NR_init_module, data, (unsigned long) s.st_size, options);
        else
                LOG("failed to read full module %s\n", path);
 
@@ -540,7 +540,9 @@ static int main_insmod(int argc, char **argv)
                cur += sprintf(cur, "%s", argv[i]);
        }
 
-       if (!get_module_path(name)) {
+       if (get_module_path(argv[1])) {
+               name = argv[1];
+       } else if (!get_module_path(name)) {
                fprintf(stderr, "Failed to find %s. Maybe it is a built in module ?\n", name);
                return -1;
        }