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>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/YFRJOkttmOWamA47vagVa23 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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 =3D NULL; > > > + static boolean_t stated =3D B_FALSE; > >=20 > > Why are those variables static? They all seem to be (re)initialized > > before first-use in the function. >=20 > 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 --Sig_/YFRJOkttmOWamA47vagVa23 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkx9Uo8ACgkQBYqIVf93VJ3ccACgnB1DUhy8ohoxxN5PL4fk5U0g MzgAoJjgiOCuaCrEsdTvR20flzhzWy1o =qe5q -----END PGP SIGNATURE----- --Sig_/YFRJOkttmOWamA47vagVa23--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100831210547.52711617>