This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] tst-gnuglob64: New test for glob64 based on tst-gnuglob



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;
> +}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]