]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-lib.sh: bugfix for pidof function
authorStig Telfer <stelfer@cray.com>
Fri, 24 Jan 2014 15:48:32 +0000 (15:48 +0000)
committerHarald Hoyer <harald@redhat.com>
Tue, 28 Jan 2014 11:19:27 +0000 (12:19 +0100)
In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop:

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

index 63401baa74dd22188fe051e1fc0dfd97bc95e52f..763b7e242d58f2ba3052e67a430cafd78b8e2cdf 100755 (executable)
@@ -974,7 +974,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
         [ -z "$_cmd" ] && return 1
         _exe=$(type -P "$1")
         for i in /proc/*/exe; do
-            [ -e "$i" ] || return 1
+            [ -e "$i" ] || continue
             if [ -n "$_exe" ]; then
                 [ "$i" -ef "$_exe" ] || continue
             else