Improve the error handling for the new get_pidfile_from_conf()
This commit is contained in:
parent
8028832653
commit
b1850238b7
@ -399,12 +399,16 @@ wait_for_pids()
|
|||||||
#
|
#
|
||||||
get_pidfile_from_conf()
|
get_pidfile_from_conf()
|
||||||
{
|
{
|
||||||
|
if [ -z "$1" -o -z "$2" ]; then
|
||||||
|
err 3 "USAGE: get_pidfile_from_conf string file ($name)"
|
||||||
|
fi
|
||||||
|
|
||||||
local string file line
|
local string file line
|
||||||
|
|
||||||
string="$1" ; file="$2"
|
string="$1" ; file="$2"
|
||||||
|
|
||||||
if [ -z "$string" -o -z "$file" ] || [ ! -s "$file" ]; then
|
if [ ! -s "$file" ]; then
|
||||||
err 3 'USAGE: get_pidfile_from_conf string file'
|
err 3 "get_pidfile_from_conf: $file does not exist ($name)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user