Re: [PATCH v2 07/11] xfsprogs: change nftw64 to nftw

Jan Tulak
2015-09-09T10:11:33Z

[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

>
> --- a/estimate/xfs_estimate.c
> +++ b/estimate/xfs_estimate.c
> @@ -168,7 +168,7 @@ main(int argc, char **argv)
> ndirs=0LL; /* number of directories */
> nspecial=0LL; /* number of special files */
>
> - nftw64(argv[optind], ffn, 40, FTW_PHYS | FTW_MOUNT);
> + nftw(argv[optind], ffn, 40, FTW_PHYS | FTW_MOUNT);
>
> if (__debug) {
> printf(_("dirsize=%llu\n"), dirsize);
> --
> 2.4.5
>
>
​Now I noticed this causes a warning:
xfs_estimate.c:171:3: warning: passing argument 2 of ‘nftw’ from
incompatible pointer type

>From ftw.h, the difference is in __nftw_func_t and __nftw64_func_t as a
second argument. However, what we pass in the code is "
int
​ ​
ffn(
​..., struct stat64 *stb, ...)". ​If I change this to struct stat, it works
and xfstests -g quick gives the same result as with 64bit variant. So I'm
sending an updated patch.

Cheers,
Jan

--
Jan Tulak
jtulak@redhat.com / jan@tulak.me

[-- Attachment #1.2: Type: text/html, Size: 3567 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]