Revert "More pthreads cleanup."
This reverts commit 2a1bb4e64677b9abbc17173c79768ed494565047
Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
diff --git a/libc/bionic/tmpfile.cpp b/libc/bionic/tmpfile.cpp
index 8419ff5..b97cc6c 100644
--- a/libc/bionic/tmpfile.cpp
+++ b/libc/bionic/tmpfile.cpp
@@ -38,8 +38,6 @@
#include <sys/types.h>
#include <unistd.h>
-#include "private/ErrnoRestorer.h"
-
class ScopedSignalBlocker {
public:
ScopedSignalBlocker() {
@@ -79,8 +77,9 @@
struct stat sb;
int rc = fstat(fd, &sb);
if (rc == -1) {
- ErrnoRestorer errno_restorer;
+ int old_errno = errno;
close(fd);
+ errno = old_errno;
return NULL;
}
}
@@ -92,8 +91,9 @@
}
// Failure. Clean up. We already unlinked, so we just need to close.
- ErrnoRestorer errno_restorer;
+ int old_errno = errno;
close(fd);
+ errno = old_errno;
return NULL;
}