[Toybox] [PATCH] modprobe: reset errno before ins_mod.

enh enh at google.com
Mon Jan 7 16:18:46 PST 2019


Otherwise in verbose mode we output bogus errors instead of `Success`.
---
 toys/pending/modprobe.c | 1 +
 1 file changed, 1 insertion(+)

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));
-- 
2.20.1.97.g81188d93c3-goog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-modprobe-reset-errno-before-ins_mod.patch
Type: text/x-patch
Size: 809 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20190107/f6863d44/attachment-0002.bin>


More information about the Toybox mailing list