Don't use TEMP_FAILURE_RETRY on close()
See https://lkml.org/lkml/2005/9/10/129 for details.
Bug: 20501816
Test: code compiles and boots with no obvious problems.
Change-Id: I5a9c470156d498852cfd81fbd59ddcf267309e73
diff --git a/init/selinux.cpp b/init/selinux.cpp
index c4b01e6..331fad6 100644
--- a/init/selinux.cpp
+++ b/init/selinux.cpp
@@ -115,7 +115,7 @@
// 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 @@
_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 @@
// 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 @@
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);
diff --git a/logd/LogTags.cpp b/logd/LogTags.cpp
index fcd45bd..ff7e762 100644
--- a/logd/LogTags.cpp
+++ b/logd/LogTags.cpp
@@ -105,7 +105,7 @@
android::base::WriteStringToFd(
formatEntry_locked(it.first, AID_ROOT), fd);
}
- TEMP_FAILURE_RETRY(close(fd));
+ close(fd);
}
}
@@ -601,7 +601,7 @@
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 @@
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;