mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
kernel: fix kernel_module_load()
This commit is contained in:
parent
0416ab0411
commit
94035ca241
1 changed files with 6 additions and 6 deletions
|
@ -46,7 +46,7 @@ int kernel_module_set_param(const char *module, const char *param, const char *v
|
|||
if (!f)
|
||||
serror("Failed set parameter %s for kernel module %s to %s", module, param, value);
|
||||
|
||||
debug(5, "Set parameter %s of kernel module %s to %s", module, param, value);
|
||||
debug(LOG_KERNEL | 5, "Set parameter %s of kernel module %s to %s", module, param, value);
|
||||
fprintf(f, "%s", value);
|
||||
fclose(f);
|
||||
|
||||
|
@ -59,7 +59,7 @@ int kernel_module_load(const char *module)
|
|||
|
||||
ret = kernel_module_loaded(module);
|
||||
if (!ret) {
|
||||
info("Kernel module %s already loaded...", module);
|
||||
debug(LOG_KERNEL | 5, "Kernel module %s already loaded...", module);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -70,13 +70,13 @@ int kernel_module_load(const char *module)
|
|||
|
||||
case 0: // child
|
||||
execlp("modprobe", "modprobe", module, (char *) 0);
|
||||
_exit(-1); // exec never returns
|
||||
exit(EXIT_FAILURE); // exec never returns
|
||||
|
||||
default:
|
||||
waitpid(pid, &ret, 0);
|
||||
}
|
||||
wait(&ret);
|
||||
|
||||
return ret;
|
||||
return kernel_module_loaded(module);
|
||||
}
|
||||
}
|
||||
|
||||
int kernel_module_loaded(const char *module)
|
||||
|
|
Loading…
Add table
Reference in a new issue