Blame SOURCES/0166-dracut-lib.sh-fixed-return-value-of-pidof.patch

712866
From e5f6899a550d749f25a19043b6842609e327cceb Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 7 May 2014 13:33:14 +0200
712866
Subject: [PATCH] dracut-lib.sh: fixed return value of pidof()
712866
712866
pidof always returned with 0, so any "while pidof" loop would not
712866
terminate.
712866
712866
Thanks "Consus" for the hint!
712866
712866
(cherry picked from commit 4e58a1ffc760e5c54e6cae5924a2439cae196848)
712866
---
712866
 modules.d/99base/dracut-lib.sh | 4 +++-
712866
 1 file changed, 3 insertions(+), 1 deletion(-)
712866
712866
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
712866
index 62facda..66977e7 100755
712866
--- a/modules.d/99base/dracut-lib.sh
712866
+++ b/modules.d/99base/dracut-lib.sh
712866
@@ -962,6 +962,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
712866
         local _cmd
712866
         local _exe
712866
         local _rl
712866
+        local _ret=1
712866
         local i
712866
         _cmd="$1"
712866
         [ -z "$_cmd" ] && return 1
712866
@@ -976,8 +977,9 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
712866
             fi
712866
             i=${i%/exe}
712866
             echo ${i##/proc/}
712866
+            _ret=0
712866
         done
712866
-        return 0
712866
+        return $_ret
712866
     }
712866
 fi
712866