The caller of "for_each_host_xx func" needs to tell three cases:
func success/ fail / not be called.
E.g, in kdump case, host_devs can be empty, and we want to know it.
Signed-off-by: Pingfan Liu <piliu@redhat.com>
local _dev
local _ret=1
- [[ "${#host_fs_types[@]}" ]] || return 0
+ [[ "${#host_fs_types[@]}" ]] || return 2
+
for _dev in "${!host_fs_types[@]}"; do
$_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
local _dev
local _ret=1
- [[ "${host_devs[@]}" ]] || return 0
+ [[ "${host_devs[@]}" ]] || return 2
for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue
local _func="$1"
local _dev
- [[ "${host_devs[@]}" ]] || return 0
+ [[ "${host_devs[@]}" ]] || return 2
for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue