use IGNORE_EINTR w/close
HANDLE_EINTR is both not safe and not useful on Linux systems.
Switch to IGNORE_EINTR like Chromium has done everywhere.
See http://crbug.com/269623 for details.
BUG=chromium:373154
TEST=`cbuildbot {arm,amd64,x86}-generic-full` passes
Change-Id: I4bbc9916b0038a149224e230cd79179afdbb9f63
Reviewed-on: https://chromium-review.googlesource.com/199851
Reviewed-by: Chris Masone <[email protected]>
Commit-Queue: Mike Frysinger <[email protected]>
Tested-by: Mike Frysinger <[email protected]>
diff --git a/chromeos/process.cc b/chromeos/process.cc
index f96a7fd..7a3a1d0 100644
--- a/chromeos/process.cc
+++ b/chromeos/process.cc
@@ -154,13 +154,13 @@
// Close parent's side of the child pipes. dup2 ours into place and
// then close our ends.
for (PipeMap::iterator i = pipe_map_.begin(); i != pipe_map_.end(); ++i) {
- HANDLE_EINTR(close(i->second.parent_fd_));
+ IGNORE_EINTR(close(i->second.parent_fd_));
HANDLE_EINTR(dup2(i->second.child_fd_, i->first));
}
// Defer the actual close() of the child fd until afterward; this lets the
// same child fd be bound to multiple fds using BindFd
for (PipeMap::iterator i = pipe_map_.begin(); i != pipe_map_.end(); ++i) {
- HANDLE_EINTR(close(i->second.child_fd_));
+ IGNORE_EINTR(close(i->second.child_fd_));
}
if (!output_file_.empty()) {
int output_handle = HANDLE_EINTR(
@@ -178,7 +178,7 @@
// Only close output_handle if it does not happen to be one of
// the two standard file descriptors we are trying to redirect.
if (output_handle != STDOUT_FILENO && output_handle != STDERR_FILENO) {
- HANDLE_EINTR(close(output_handle));
+ IGNORE_EINTR(close(output_handle));
}
}
if (gid_ != static_cast<gid_t>(-1) && setresgid(gid_, gid_, gid_) < 0) {
@@ -205,7 +205,7 @@
UpdatePid(pid);
// Close our copy of child side pipes.
for (PipeMap::iterator i = pipe_map_.begin(); i != pipe_map_.end(); ++i) {
- HANDLE_EINTR(close(i->second.child_fd_));
+ IGNORE_EINTR(close(i->second.child_fd_));
}
}
return true;
@@ -291,7 +291,7 @@
// handle sigpipes and shutdown nicely, though likely it won't
// have time.
for (PipeMap::iterator i = pipe_map_.begin(); i != pipe_map_.end(); ++i)
- HANDLE_EINTR(close(i->second.parent_fd_));
+ IGNORE_EINTR(close(i->second.parent_fd_));
pipe_map_.clear();
if (pid_)
Kill(SIGKILL, 0);