]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
pidofproc: fix checking if pidfile was specified
authorKrzysztof Mazur <krzysiek@podlesie.net>
Sat, 21 Nov 2015 12:38:35 +0000 (13:38 +0100)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 23 Nov 2015 12:01:51 +0000 (14:01 +0200)
The commit 2ec0a78e657d8df42c4f3f23ee9a8d26a5acf1aa
(pidofproc: do not fallback, if pidfile was specified)
always disabled the fallback, not only if pidfile was specified.
If pidfile is not specified, the pidfile variable is still initialized
to "$base.pid", and is non-empty. Fix it by checking if the pidfile
argument is non-empty.

lib/functions

index 8d018f7120497e270050e861c80ba3dbf4613b2b..501cac9fc1e5e34cac1a5ff62c19f6f3536a4955 100644 (file)
@@ -1009,7 +1009,7 @@ pidofproc() {
        fi
 
        # Next try "pidof" if pidfile is not specified
-       if [ -z "$pid" ] && [ -z "$pidfile" ]; then
+       if [ -z "$pid" ] && [ -z "$2" ]; then
                pid=$(pidof -o $$ -o $PPID -o %PPID -x "$1")
        fi
 
This page took 0.104135 seconds and 4 git commands to generate.