Author: dougb
Date: Sat Apr 23 05:24:17 2011
New Revision: 220963
URL: http://svn.freebsd.org/changeset/base/220963

Log:
  Improve the error handling for the new get_pidfile_from_conf()

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==============================================================================
--- head/etc/rc.subr    Sat Apr 23 04:26:31 2011        (r220962)
+++ head/etc/rc.subr    Sat Apr 23 05:24:17 2011        (r220963)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to