Merge "Don't use TEMP_FAILURE_RETRY on close()"

This commit is contained in:
Treehugger Robot 2017-10-24 19:47:20 +00:00 committed by Gerrit Code Review
commit 0f2097c0f0
2 changed files with 7 additions and 7 deletions

View file

@ -115,7 +115,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
// fork succeeded -- this is executing in the child process
// Close the pipe FD not used by this process
TEMP_FAILURE_RETRY(close(pipe_fds[0]));
close(pipe_fds[0]);
// Redirect stderr to the pipe FD provided by the parent
if (TEMP_FAILURE_RETRY(dup2(pipe_fds[1], STDERR_FILENO)) == -1) {
@ -123,7 +123,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
_exit(127);
return false;
}
TEMP_FAILURE_RETRY(close(pipe_fds[1]));
close(pipe_fds[1]);
if (execv(filename, argv) == -1) {
PLOG(ERROR) << "Failed to execve " << filename;
@ -137,7 +137,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
// fork succeeded -- this is executing in the original/parent process
// Close the pipe FD not used by this process
TEMP_FAILURE_RETRY(close(pipe_fds[1]));
close(pipe_fds[1]);
// Log the redirected output of the child process.
// It's unfortunate that there's no standard way to obtain an istream for a file descriptor.
@ -148,7 +148,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
if (!android::base::ReadFdToString(child_out_fd, &child_output)) {
PLOG(ERROR) << "Failed to capture full output of " << filename;
}
TEMP_FAILURE_RETRY(close(child_out_fd));
close(child_out_fd);
if (!child_output.empty()) {
// Log captured output, line by line, because LOG expects to be invoked for each line
std::istringstream in(child_output);

View file

@ -105,7 +105,7 @@ bool LogTags::RebuildFileEventLogTags(const char* filename, bool warn) {
android::base::WriteStringToFd(
formatEntry_locked(it.first, AID_ROOT), fd);
}
TEMP_FAILURE_RETRY(close(fd));
close(fd);
}
}
@ -601,7 +601,7 @@ void LogTags::WriteDynamicEventLogTags(uint32_t tag, uid_t uid) {
std::string ret = formatEntry_locked(tag, uid, false);
android::base::WriteStringToFd(ret, fd);
TEMP_FAILURE_RETRY(close(fd));
close(fd);
size_t size = 0;
file2watermark_const_iterator iwater;
@ -625,7 +625,7 @@ void LogTags::WriteDebugEventLogTags(uint32_t tag, uid_t uid) {
std::string ret = formatEntry_locked(tag, uid, false);
android::base::WriteStringToFd(ret, fd);
TEMP_FAILURE_RETRY(close(fd));
close(fd);
size_t size = 0;
file2watermark_const_iterator iwater;