Date: Tue, 31 Aug 2010 21:05:47 +0200 From: Fabian Keil <freebsd-listen@fabiankeil.de> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r212050 - head/cddl/contrib/opensolaris/cmd/zpool Message-ID: <20100831210547.52711617@r500.local> In-Reply-To: <20100831185752.GA1932@garage.freebsd.pl> References: <201008311041.o7VAfrAF028012@svn.freebsd.org> <20100831204421.4ad0a99a@r500.local> <20100831185752.GA1932@garage.freebsd.pl>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Pawel Jakub Dawidek <pjd@FreeBSD.org> wrote:
> On Tue, Aug 31, 2010 at 08:44:21PM +0200, Fabian Keil wrote:
> > Pawel Jakub Dawidek <pjd@FreeBSD.org> wrote:
> > > static int
> > > +is_root_pool(zpool_handle_t *zhp)
> > > +{
> > > + static struct statfs sfs;
> > > + static char *poolname = NULL;
> > > + static boolean_t stated = B_FALSE;
> >
> > Why are those variables static? They all seem to be (re)initialized
> > before first-use in the function.
>
> Not really. We enter while () loop only if stated is false and it will
> be false only for the first call. By having those variables static we
> statfs(2) the root file system only once.
Right, I missed that. Thanks.
Fabian
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)
iEYEARECAAYFAkx9Uo8ACgkQBYqIVf93VJ3ccACgnB1DUhy8ohoxxN5PL4fk5U0g
MzgAoJjgiOCuaCrEsdTvR20flzhzWy1o
=qe5q
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100831210547.52711617>
