Revert "More pthreads cleanup."
This reverts commit 2a1bb4e646
Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
This commit is contained in:
committed by
Gerrit Code Review
parent
2a1bb4e646
commit
6f94de3ca4
@@ -38,8 +38,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "private/ErrnoRestorer.h"
|
||||
|
||||
class ScopedSignalBlocker {
|
||||
public:
|
||||
ScopedSignalBlocker() {
|
||||
@@ -79,8 +77,9 @@ static FILE* __tmpfile_dir(const char* tmp_dir) {
|
||||
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 @@ static FILE* __tmpfile_dir(const char* tmp_dir) {
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user