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

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