Subject: Re: bug#5827: [PATCH] tail: include sys/vfs.h

From: Marc Kleine-Budde <[email-masked]>
Date: Sun, 04 Apr 2010 11:48:45 +0200

Hey Jim,

Jim Meyering wrote:
> Marc Kleine-Budde wrote:
>> the latest coreutils release 8.4 and current git master fail during the
>> (cross-) compilation of tail. The used components are:
>>
>> gcc-4.3.2
>> glibc-2.8
>> binutils-2.18
>>
>> The following patch fixes the commit. It's against git master, but should
>> apply on 8.4, too.
> ...
>>  # if HAVE_SYS_STATFS_H
>>  #  include <sys/statfs.h>
>>  # endif
>> +# if HAVE_SYS_VFS_H
>> +#  include <sys/vfs.h>
>> +# endif
>>  #endif
> 
> I'd like to take a slightly more conservative approach,
> including sys/vfs.h only when sys/statfs.h is not available.
> Does this work for you?

Thanks, works, even with older gcc/glibc combinations.

>>>From 98dacf492e2e6f2153455cb4179058578cee20ff Mon Sep 17 00:00:00 2001
> From: Marc Kleine-Budde <[email-masked]>
> Date: Sun, 4 Apr 2010 09:15:07 +0200
> Subject: [PATCH] tail: include sys/vfs.h (if possible) when sys/statfs.h is absent
> 
> * src/tail.c [HAVE_INOTIFY && !HAVE_SYS_STATFS_H]: Include <sys/vfs.h>.

Tested-by: Marc Kleine-Budde <[email-masked]>

> ---
>  src/tail.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/tail.c b/src/tail.c
> index 02c4a1a..9e95dee 100644
> --- a/src/tail.c
> +++ b/src/tail.c
> @@ -56,6 +56,8 @@
>  # include "fs.h"
>  # if HAVE_SYS_STATFS_H
>  #  include <sys/statfs.h>
> +# elif HAVE_SYS_VFS_H
> +#  include <sys/vfs.h>
>  # endif
>  #endif
> 
> --
> 1.7.0.4.529.g78fb

cheers, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |