]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-lib.sh: fixed return value of pidof()
authorHarald Hoyer <harald@redhat.com>
Wed, 7 May 2014 11:33:14 +0000 (13:33 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 7 May 2014 11:34:31 +0000 (13:34 +0200)
pidof always returned with 0, so any "while pidof" loop would not
terminate.

Thanks "Consus" for the hint!

modules.d/99base/dracut-lib.sh

index 127287cca56040d361252c5cd7b170f26b249ed2..33f76784ca1c6a61d12632e2890711bc1e9e89c2 100755 (executable)
@@ -983,6 +983,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
         local _cmd
         local _exe
         local _rl
+        local _ret=1
         local i
         _cmd="$1"
         [ -z "$_cmd" ] && return 1
@@ -997,8 +998,9 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
             fi
             i=${i%/exe}
             echo ${i##/proc/}
+            _ret=0
         done
-        return 0
+        return $_ret
     }
 fi