libstdc++/70762 fix fallback implementation of nonexistent_path

PR libstdc++/70762
	* testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use
	static counter to return a different path on every call.

From-SVN: r235395
This commit is contained in:
Jonathan Wakely 2016-04-24 19:06:54 +01:00 committed by Jonathan Wakely
parent e4dbabfe54
commit a635cdb2cc
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-04-24 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/70762
* testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use
static counter to return a different path on every call.
2016-04-22 Tim Shen <timshen@google.com>
PR libstdc++/70745

View File

@ -83,11 +83,13 @@ namespace __gnu_test
p = tmp;
#else
char buf[64];
static int counter;
#if _GLIBCXX_USE_C99_STDIO
std::snprintf(buf, 64, "filesystem-ts-test.%lu", (unsigned long)::getpid());
std::snprintf(buf, 64,
#else
std::sprintf(buf, "filesystem-ts-test.%lu", (unsigned long)::getpid());
std::sprintf(buf,
#endif
"filesystem-ts-test.%d.%lu", counter++, (unsigned long) ::getpid());
p = buf;
#endif
return p;