[collectd] df plugins doesn't compile on OpenBSD 4.3

Sebastian Harl sh at tokkee.org
Wed Dec 30 11:36:23 CET 2009


Hi Andreas,

On Wed, Dec 30, 2009 at 10:38:40AM +0100, Andreas Maus wrote:
> The only error occurs on OpenBSD 4.3 compiling the df plugin:
[…]
> df.c:313: error: structure has no member named `f_favail'

> The member f_favail in the structure statfs has been introduced in OpenBSD 4.4.
> 
> I modified the configure.in and src/df.c files to check the availability of
> f_favail (see attached diff).

Thanks for your patch! See a minor comment below.

> +#ifdef HAVE_STATFS_F_FAVAIL
>  			inode_free = (uint64_t) statbuf.f_favail;
>  			inode_reserved = (uint64_t) (statbuf.f_ffree - statbuf.f_favail);
> +#else
> +			inode_free = (uint64_t) statbuf.f_ffree;
> +			inode_reserved = (uint64_t) 0;
> +#endif

Rather than setting the value to zero, if f_favail is not available, I'd
not submit the free (and reserved, which is calculated using f_favail)
at all.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20091230/48beaa16/attachment.pgp 


More information about the collectd mailing list