2015-05-20 Jonathan Wakely <jwakely@redhat.com>
+ * testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam.
+
PR libstdc++/66078
* include/bits/stl_iterator.h (__make_move_if_noexcept_iterator): Add
overload for pointers.
#include <iostream>
#include <string>
#include <cstdio>
-#if defined(_GNU_SOURCE) || _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L
-# include <stdlib.h>
-# include <unistd.h>
-#endif
+#include <stdlib.h>
+#include <unistd.h>
namespace __gnu_test
{
::close(fd);
p = tmp;
#else
- char* tmp = tempnam(".", "test.");
- if (!tmp)
- throw std::experimental::filesystem::filesystem_error("tempnam failed",
- std::error_code(errno, std::generic_category()));
- p = tmp;
- ::free(tmp);
+ char buf[64];
+ std::sprintf(buf, "test.%lu", (unsigned long)::getpid());
+ p = buf;
#endif
return p;
}