Harald Hoyer 3610a1
From 2bdce3d461a2d790d3bde41efb533c5e2881ee76 Mon Sep 17 00:00:00 2001
Harald Hoyer 3610a1
From: Harald Hoyer <harald@hoyer.xyz>
Harald Hoyer 3610a1
Date: Wed, 6 Dec 2017 14:49:42 +0100
Harald Hoyer 3610a1
Subject: [PATCH] Merge pull request #311 from
Harald Hoyer 3610a1
 dracut-mailing-devs/1512379451-17727-1-git-send-email-piliu@redhat.com
Harald Hoyer 3610a1
Harald Hoyer 3610a1
dracut.sh: for_each_host_xx() function should indicate the empty case
Harald Hoyer 3610a1
---
Harald Hoyer 3610a1
 dracut-functions.sh | 7 ++++---
Harald Hoyer 3610a1
 1 file changed, 4 insertions(+), 3 deletions(-)
Harald Hoyer 3610a1
Harald Hoyer 3610a1
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 3610a1
index 112b2434..575bd4a6 100755
Harald Hoyer 3610a1
--- a/dracut-functions.sh
Harald Hoyer 3610a1
+++ b/dracut-functions.sh
Harald Hoyer 3610a1
@@ -468,7 +468,8 @@ for_each_host_dev_fs()
Harald Hoyer 3610a1
     local _dev
Harald Hoyer 3610a1
     local _ret=1
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
-    [[ "${#host_fs_types[@]}" ]] || return 0
Harald Hoyer 3610a1
+    [[ "${#host_fs_types[@]}" ]] || return 2
Harald Hoyer 3610a1
+
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
     for _dev in "${!host_fs_types[@]}"; do
Harald Hoyer 3610a1
         $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
Harald Hoyer 3610a1
@@ -527,7 +528,7 @@ for_each_host_dev_and_slaves_all()
Harald Hoyer 3610a1
     local _dev
Harald Hoyer 3610a1
     local _ret=1
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
-    [[ "${host_devs[@]}" ]] || return 0
Harald Hoyer 3610a1
+    [[ "${host_devs[@]}" ]] || return 2
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
     for _dev in "${host_devs[@]}"; do
Harald Hoyer 3610a1
         [[ -b "$_dev" ]] || continue
Harald Hoyer 3610a1
@@ -543,7 +544,7 @@ for_each_host_dev_and_slaves()
Harald Hoyer 3610a1
     local _func="$1"
Harald Hoyer 3610a1
     local _dev
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
-    [[ "${host_devs[@]}" ]] || return 0
Harald Hoyer 3610a1
+    [[ "${host_devs[@]}" ]] || return 2
Harald Hoyer 3610a1
 
Harald Hoyer 3610a1
     for _dev in "${host_devs[@]}"; do
Harald Hoyer 3610a1
         [[ -b "$_dev" ]] || continue
Harald Hoyer 3610a1