aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-01-07 16:13:49 -0800
committerRob Landley <rob@landley.net>2019-01-07 19:27:58 -0600
commit695c62fbbb2a403c517636049b8ddfe66d836480 (patch)
treecaeb69bb64c5d824510934785b3c366508f82c54
parentbfbdd4a2db0c65a917a88746a93ec5ae9d378063 (diff)
downloadtoybox-695c62fbbb2a403c517636049b8ddfe66d836480.tar.gz
modprobe: reset errno before ins_mod.
Otherwise in verbose mode we output bogus errors instead of `Success`.
-rw-r--r--toys/pending/modprobe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/pending/modprobe.c b/toys/pending/modprobe.c
index 0c0cbc83..cbcfac8f 100644
--- a/toys/pending/modprobe.c
+++ b/toys/pending/modprobe.c
@@ -480,6 +480,7 @@ static int go_probe(struct module_s *m)
continue;
}
// none of above is true insert the module.
+ errno = 0;
rc = ins_mod(fn, options);
if (toys.optflags&FLAG_v)
printf("loaded %s '%s': %s\n", fn, options, strerror(errno));