summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2011-04-23 05:24:17 +0000
committerdougb <dougb@FreeBSD.org>2011-04-23 05:24:17 +0000
commite90e1b5c2c9a6bf9cdd0a686c1427d43a03b4529 (patch)
treed56e220e958fe05c06bc5e53f3d2cd41b59fed92 /etc/rc.subr
parentd05cc95927280821298e08e1be9fe78cc987ad6c (diff)
downloadFreeBSD-src-e90e1b5c2c9a6bf9cdd0a686c1427d43a03b4529.zip
FreeBSD-src-e90e1b5c2c9a6bf9cdd0a686c1427d43a03b4529.tar.gz
Improve the error handling for the new get_pidfile_from_conf()
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr8
1 files changed, 6 insertions, 2 deletions
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
OpenPOWER on IntegriCloud