summaryrefslogtreecommitdiff
path: root/src/modules-load
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-10-08 16:18:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-10-08 22:29:32 +0200
commit2c3f0bb207f89f0347a4a84a8cde57e979f33896 (patch)
tree7c9d89c7710e97ca1a691fa6fbf1b385cbc1de5d /src/modules-load
parent232ac0d6810498dc7a3a6b9d1fd4dca983e1535f (diff)
downloadsystemd-2c3f0bb207f89f0347a4a84a8cde57e979f33896.tar.gz
systemd-2c3f0bb207f89f0347a4a84a8cde57e979f33896.tar.bz2
systemd-2c3f0bb207f89f0347a4a84a8cde57e979f33896.zip
kmod_module_probe_insert_module returns 0 on success, != 0 on failure
More specifically, it should return > 0 only for conditions specified in probe_flags. We only set KMOD_PROBE_APPLY_BLACKLIST in probe_flags, so the code was correct, but add an assert to clarify this.
Diffstat (limited to 'src/modules-load')
-rw-r--r--src/modules-load/modules-load.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
index 1cb9001c39..c1a89cf822 100644
--- a/src/modules-load/modules-load.c
+++ b/src/modules-load/modules-load.c
@@ -118,8 +118,9 @@ static int load_module(struct kmod_ctx *ctx, const char *m) {
else if (err == KMOD_PROBE_APPLY_BLACKLIST)
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
else {
- log_error_errno(err, "Failed to insert '%s': %m", kmod_module_get_name(mod));
- r = err;
+ assert(err < 0);
+ r = log_error_errno(err, "Failed to insert '%s': %m",
+ kmod_module_get_name(mod));
}
}
}