Pawel Jakub Dawidek <p...@freebsd.org> wrote:

> On Tue, Aug 31, 2010 at 08:44:21PM +0200, Fabian Keil wrote:
> > Pawel Jakub Dawidek <p...@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: signature.asc
Description: PGP signature

Reply via email to