This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] tst-gnuglob64: New test for glob64 based on tst-gnuglob
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 30 Oct 2017 09:43:36 -0200
- Subject: Re: [PATCH] tst-gnuglob64: New test for glob64 based on tst-gnuglob
- Authentication-results: sourceware.org; auth=none
- References: <eca426d0-5ce2-8e35-b030-b0ae461745cc@redhat.com>
On 30/10/2017 08:48, Florian Weimer wrote:
> I have verified that this catches the glob64 symbol regression I introduced on the 2.26 stable branch.
>
> Thanks,
> Florian
>
> tst-gnuglob64.patch
>
>
> 2017-10-30 Florian Weimer <fweimer@redhat.com>
>
> * posix/tst-gnuglob-skeleton.c: Renamed from tst-gnuglob.c.
> Convert to support/test-driver.c.
> (GLOB_FUNC, GLOB_TYPE, GLOBFREE_FUNC, DIRENT_STRUCT, STAT_STRUCT):
> New macro parameters.
> (PRINTF): Remove macro. Use test_verbose conditionals instead.
Ok.
> * posix/tst-gnuglob.c: New file.
> * posix/tst-gnuglob64.c: Likewise.
> * posix/Makefile (tests): Add tst-gnuglob64.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> +
> +#ifdef _DIRENT_HAVE_D_TYPE
> + dir->d.d_type = filesystem[dir->idx].type;
> +#endif
I think we can remove the _DIRENT_HAVE_D_TYPE check since afaik all supported
architectures define it _DIRENT_HAVE_D_TYPE.
> +
> + strcpy (dir->d.d_name, filesystem[dir->idx].name);
> +
> +#ifdef _DIRENT_HAVE_D_TYPE
> + if (test_verbose > 0)
> + printf ("info: my_readdir ({ level: %d, idx: %ld })"
> + " = { d_ino: %lld, d_type: %d, d_name: \"%s\" }\n",
> + dir->level, (long int) dir->idx,
> + (long long) dir->d.d_ino, dir->d.d_type,
> + dir->d.d_name);
> +#else
> + if (test_verbose > 0)
> + printf ("info: my_readdir ({ level: %d, idx: %ld })"
> + " = { d_ino: %lld, d_name: \"%s\" }\n",
> + dir->level, (long int) dir->idx,
> + (long long) dir->d.d_ino,
> + dir->d.d_name);
> +#endif
> +
> + ++dir->idx;
> +
> + return &dir->d;
> +}