aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/testing/googletest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/testing/googletest.cc')
-rw-r--r--src/google/protobuf/testing/googletest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc
index 1339b33..cd094d0 100644
--- a/src/google/protobuf/testing/googletest.cc
+++ b/src/google/protobuf/testing/googletest.cc
@@ -46,6 +46,8 @@
#endif
#include <stdio.h>
#include <fcntl.h>
+#include <iostream>
+#include <fstream>
namespace google {
namespace protobuf {
@@ -94,7 +96,8 @@ string GetTemporaryDirectoryName() {
// tmpnam() is generally not considered safe but we're only using it for
// testing. We cannot use tmpfile() or mkstemp() since we're creating a
// directory.
- string result = tmpnam(NULL);
+ char b[L_tmpnam + 1]; // HPUX multithread return 0 if s is 0
+ string result = tmpnam(b);
#ifdef _WIN32
// On Win32, tmpnam() returns a file prefixed with '\', but which is supposed
// to be used in the current working directory. WTF?