Date: Mon, 27 Sep 2010 15:05:43 +0200 From: Paul Schenkeveld <fb-hackers@psconsult.nl> To: freebsd-hackers@freebsd.org Subject: Re: little mistake in rc.subr? Message-ID: <20100927130542.GA38728@psconsult.nl> In-Reply-To: <20100927120129.GF95673@e.0x20.net> References: <20100927150421.260874f0@amnesiac.pht> <20100927120129.GF95673@e.0x20.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 27, 2010 at 02:01:29PM +0200, Lars Engels wrote: > On Mon, Sep 27, 2010 at 03:04:21PM +0400, Dmitry Banshchikov wrote: > > Hello, > > > > In /etc/rc.subr, at line 231, there is: > > > > if [ ! -f $_pidfile ]; then > > debug "pid file ($_pidfile): not readable." > > return > > fi > > > > Is check "[ ! -r $_pidfile ]" more correct? > > There's pratically no difference. rc stuff is run as root, so if there's > a file, it's readable, if there's no file, then the debug message is > printed. And -f also checks that it is a regular file (or symlink to a regular file).
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100927130542.GA38728>