summaryrefslogtreecommitdiff
path: root/libkmod
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2015-06-13 18:29:47 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2015-06-13 18:29:47 -0300
commit114ec87c85c35a2bd3682f9f891e494127be6fb5 (patch)
treefe8449d2025ef691dfef60e7679b95f3daf6ef8e /libkmod
parent0d833715eaa65636dda2705b89359a1e0154dc58 (diff)
downloadkmod-114ec87c85c35a2bd3682f9f891e494127be6fb5.tar.gz
kmod-114ec87c85c35a2bd3682f9f891e494127be6fb5.tar.bz2
kmod-114ec87c85c35a2bd3682f9f891e494127be6fb5.zip
libkmod-module: fix return code in error path
ENOSYS is the wrong errno to return when we don't find a module in kmod_module_insert_module(). Why is it there in the first place? This goes back to kmod v1 when we couldn't load modules by names, but we should give a path instead. 708624a ("ELF: initial support for modinfo and strip of modversions and vermagic.") changed that so we do a lazy-search by the module path in this function. Later f304afe ("Change error message to reflect reality") fixed the log message but the return coded remained the same.
Diffstat (limited to 'libkmod')
-rw-r--r--libkmod/libkmod-module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 366308f..50b2ff9 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -830,7 +830,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod,
path = kmod_module_get_path(mod);
if (path == NULL) {
ERR(mod->ctx, "could not find module by name='%s'\n", mod->name);
- return -ENOSYS;
+ return -ENOENT;
}
mod->file = kmod_file_open(mod->ctx, path);