From e90e1b5c2c9a6bf9cdd0a686c1427d43a03b4529 Mon Sep 17 00:00:00 2001 From: dougb Date: Sat, 23 Apr 2011 05:24:17 +0000 Subject: Improve the error handling for the new get_pidfile_from_conf() --- etc/rc.subr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'etc/rc.subr') diff --git a/etc/rc.subr b/etc/rc.subr index 74a6b63..3a6f76a 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -399,12 +399,16 @@ wait_for_pids() # 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 string="$1" ; file="$2" - if [ -z "$string" -o -z "$file" ] || [ ! -s "$file" ]; then - err 3 'USAGE: get_pidfile_from_conf string file' + if [ ! -s "$file" ]; then + err 3 "get_pidfile_from_conf: $file does not exist ($name)" fi while read line; do -- cgit v1.1