]> 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, 29 Jul 2014 09:52:05 +0000 (11:52 +0200)
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 61e5a81aaee7cec85f0e76f63ce2023082e09fd0..d892c26db644792f906391aef417591dc85a6dab 100755 (executable)
@@ -967,7 +967,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