Skip to content

Commit 0819d1f

Browse files
committed
check: reimplement _unload_modules() with _patient_rmmod()
To make the helper function _unload_modules() more robust, reimplement it to call _patient_rmmod(). Another function with the similar name _unload_module() is left as it is. Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 7947f59 commit 0819d1f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

check

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,13 @@ _unload_module() {
596596
}
597597

598598
_unload_modules() {
599-
local i
599+
local i reason
600600

601601
for ((i=${#MODULES_TO_UNLOAD[@]}; i > 0; i--)); do
602-
_unload_module "${MODULES_TO_UNLOAD[i-1]}" 10
602+
if ! reason=$(_patient_rmmod "${MODULES_TO_UNLOAD[i-1]}" \
603+
2>&1); then
604+
echo "${reason}" >&2
605+
fi
603606
done
604607

605608
unset MODULES_TO_UNLOAD

0 commit comments

Comments
 (0)