Commit 7769c9de by Jonathan Wakely Committed by Jonathan Wakely

* testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam.

From-SVN: r223450
parent 793cac74
2015-05-20 Jonathan Wakely <jwakely@redhat.com> 2015-05-20 Jonathan Wakely <jwakely@redhat.com>
* testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam.
PR libstdc++/66078 PR libstdc++/66078
* include/bits/stl_iterator.h (__make_move_if_noexcept_iterator): Add * include/bits/stl_iterator.h (__make_move_if_noexcept_iterator): Add
overload for pointers. overload for pointers.
......
...@@ -26,10 +26,8 @@ ...@@ -26,10 +26,8 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <cstdio> #include <cstdio>
#if defined(_GNU_SOURCE) || _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L #include <stdlib.h>
# include <stdlib.h> #include <unistd.h>
# include <unistd.h>
#endif
namespace __gnu_test namespace __gnu_test
{ {
...@@ -84,12 +82,9 @@ namespace __gnu_test ...@@ -84,12 +82,9 @@ namespace __gnu_test
::close(fd); ::close(fd);
p = tmp; p = tmp;
#else #else
char* tmp = tempnam(".", "test."); char buf[64];
if (!tmp) std::sprintf(buf, "test.%lu", (unsigned long)::getpid());
throw std::experimental::filesystem::filesystem_error("tempnam failed", p = buf;
std::error_code(errno, std::generic_category()));
p = tmp;
::free(tmp);
#endif #endif
return p; return p;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment