libstdc++/70762 fix fallback implementation of nonexistent_path
authorJonathan Wakely <jwakely@redhat.com>
Sun, 24 Apr 2016 18:06:54 +0000 (19:06 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 24 Apr 2016 18:06:54 +0000 (19:06 +0100)
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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/util/testsuite_fs.h

index 386e83285285245641a7f6bdb189fb8aaf600904..e50b9ad26fc549cf139c3c52664210666409f421 100644 (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
index d2b3b1848ee97678d210dde450dcc71c14f74c5b..f1e0bfcc252d7b9001bbcdd3527077b2417c24cc 100644 (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;