system/core
修订版 | 5665cf21409d9443e8afbb83d77d4bddcbec6d38 (tree) |
---|---|
时间 | 2018-03-05 19:24:24 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
modprobe: fix return value
It seems bionic ignores the return value of the main function.
As a result, kernel won't know modprobe failed. That may cause
kernel panic.
Using exit() function to fix that.
@@ -558,7 +558,7 @@ int modprobe_main(int argc, char **argv) | ||
558 | 558 | DeviceHandler dh; |
559 | 559 | dh.ReadModulesDescFiles(); |
560 | 560 | dh.OnColdBootDone(); |
561 | - return dh.LoadModule(uevent) || dh.LoadModule(uevent.modalias, options.c_str()) ? 0 : -1; | |
561 | + exit(!dh.LoadModule(uevent) && !dh.LoadModule(uevent.modalias, options.c_str())); | |
562 | 562 | } |
563 | 563 | |
564 | 564 | } // namespace init |