[VM] Remove retry logic from close(fd) calls

This covers Linux, Mac, Android, and Fuchsia.

Bug: https://github.com/dart-lang/sdk/issues/35954
Fixes: https://github.com/dart-lang/sdk/issues/35954
Change-Id: I8142332c530be8ad3ce46312a4a5ac750953c288
Reviewed-on: https://dart-review.googlesource.com/c/93320
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc
index 2b6147c..6af505f 100644
--- a/runtime/bin/crypto_android.cc
+++ b/runtime/bin/crypto_android.cc
@@ -28,13 +28,13 @@
         read(fd, buffer + bytes_read, count - bytes_read));
     if (res < 0) {
       int err = errno;
-      VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+      close(fd);
       errno = err;
       return false;
     }
     bytes_read += res;
   } while (bytes_read < count);
-  VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+  close(fd);
   return true;
 }
 
diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc
index 0a9fcb1..9a14ee3 100644
--- a/runtime/bin/crypto_linux.cc
+++ b/runtime/bin/crypto_linux.cc
@@ -28,13 +28,13 @@
         read(fd, buffer + bytes_read, count - bytes_read));
     if (res < 0) {
       int err = errno;
-      VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+      close(fd);
       errno = err;
       return false;
     }
     bytes_read += res;
   } while (bytes_read < count);
-  VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+  close(fd);
   return true;
 }
 
diff --git a/runtime/bin/crypto_macos.cc b/runtime/bin/crypto_macos.cc
index c799d07..5d0690e 100644
--- a/runtime/bin/crypto_macos.cc
+++ b/runtime/bin/crypto_macos.cc
@@ -28,13 +28,13 @@
         read(fd, buffer + bytes_read, count - bytes_read));
     if (res < 0) {
       int err = errno;
-      VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+      close(fd);
       errno = err;
       return false;
     }
     bytes_read += res;
   } while (bytes_read < count);
-  VOID_TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(close(fd));
+  close(fd);
   return true;
 }
 
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index 10e4818..4fe2832 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -120,9 +120,9 @@
 
 EventHandlerImplementation::~EventHandlerImplementation() {
   socket_map_.Clear(DeleteDescriptorInfo);
-  VOID_TEMP_FAILURE_RETRY(close(epoll_fd_));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[0]));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[1]));
+  close(epoll_fd_);
+  close(interrupt_fds_[0]);
+  close(interrupt_fds_[1]);
 }
 
 void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
diff --git a/runtime/bin/eventhandler_android.h b/runtime/bin/eventhandler_android.h
index 0cfd543..d8cceca 100644
--- a/runtime/bin/eventhandler_android.h
+++ b/runtime/bin/eventhandler_android.h
@@ -30,7 +30,7 @@
   intptr_t GetPollEvents();
 
   virtual void Close() {
-    VOID_TEMP_FAILURE_RETRY(close(fd_));
+    close(fd_);
     fd_ = -1;
   }
 
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 1a4283f..142f0b1 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -127,10 +127,10 @@
 
 EventHandlerImplementation::~EventHandlerImplementation() {
   socket_map_.Clear(DeleteDescriptorInfo);
-  VOID_TEMP_FAILURE_RETRY(close(epoll_fd_));
-  VOID_TEMP_FAILURE_RETRY(close(timer_fd_));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[0]));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[1]));
+  close(epoll_fd_);
+  close(timer_fd_);
+  close(interrupt_fds_[0]);
+  close(interrupt_fds_[1]);
 }
 
 void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h
index ac468dc..31cb3ec 100644
--- a/runtime/bin/eventhandler_linux.h
+++ b/runtime/bin/eventhandler_linux.h
@@ -29,7 +29,7 @@
   intptr_t GetPollEvents();
 
   virtual void Close() {
-    VOID_TEMP_FAILURE_RETRY(close(fd_));
+    close(fd_);
     fd_ = -1;
   }
 
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index 052e746..e3d5a9a 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -137,9 +137,9 @@
 
 EventHandlerImplementation::~EventHandlerImplementation() {
   socket_map_.Clear(DeleteDescriptorInfo);
-  VOID_TEMP_FAILURE_RETRY(close(kqueue_fd_));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[0]));
-  VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[1]));
+  close(kqueue_fd_);
+  close(interrupt_fds_[0]);
+  close(interrupt_fds_[1]);
 }
 
 void EventHandlerImplementation::UpdateKQueueInstance(intptr_t old_mask,
diff --git a/runtime/bin/eventhandler_macos.h b/runtime/bin/eventhandler_macos.h
index 7550fce..a7684f2 100644
--- a/runtime/bin/eventhandler_macos.h
+++ b/runtime/bin/eventhandler_macos.h
@@ -30,7 +30,7 @@
   intptr_t GetPollEvents();
 
   virtual void Close() {
-    VOID_TEMP_FAILURE_RETRY(close(fd_));
+    close(fd_);
     fd_ = -1;
   }
 
diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc
index 86e501b..de1fb6b 100644
--- a/runtime/bin/fdutils_android.cc
+++ b/runtime/bin/fdutils_android.cc
@@ -132,7 +132,7 @@
 
 void FDUtils::SaveErrorAndClose(intptr_t fd) {
   int err = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
   errno = err;
 }
 
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc
index 2cc20c5..1caa786 100644
--- a/runtime/bin/fdutils_linux.cc
+++ b/runtime/bin/fdutils_linux.cc
@@ -132,7 +132,7 @@
 
 void FDUtils::SaveErrorAndClose(intptr_t fd) {
   int err = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
   errno = err;
 }
 
diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc
index e691506..341e85f 100644
--- a/runtime/bin/fdutils_macos.cc
+++ b/runtime/bin/fdutils_macos.cc
@@ -132,7 +132,7 @@
 
 void FDUtils::SaveErrorAndClose(intptr_t fd) {
   int err = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
   errno = err;
 }
 
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 918565a..0ef2414 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -56,9 +56,9 @@
     int null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY));
     ASSERT(null_fd >= 0);
     VOID_TEMP_FAILURE_RETRY(dup2(null_fd, handle_->fd()));
-    VOID_TEMP_FAILURE_RETRY(close(null_fd));
+    close(null_fd);
   } else {
-    int err = TEMP_FAILURE_RETRY(close(handle_->fd()));
+    int err = close(handle_->fd());
     if (err != 0) {
       const int kBufferSize = 1024;
       char error_buf[kBufferSize];
@@ -402,7 +402,7 @@
       openat(newns.fd(), newns.path(), O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC,
              st.st_mode));
   if (new_fd < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(old_fd));
+    close(old_fd);
     return false;
   }
   off_t offset = 0;
@@ -427,8 +427,8 @@
     }
   }
   int e = errno;
-  VOID_TEMP_FAILURE_RETRY(close(old_fd));
-  VOID_TEMP_FAILURE_RETRY(close(new_fd));
+  close(old_fd);
+  close(new_fd);
   if (result < 0) {
     VOID_NO_RETRY_EXPECTED(unlinkat(newns.fd(), newns.path(), 0));
     errno = e;
diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc
index 40aaf7d..9ee69ea 100644
--- a/runtime/bin/file_fuchsia.cc
+++ b/runtime/bin/file_fuchsia.cc
@@ -395,7 +395,7 @@
       openat(newns.fd(), newns.path(),
              O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, st.st_mode));
   if (new_fd < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(old_fd));
+    close(old_fd);
     return false;
   }
   // TODO(ZX-429): Use sendfile/copyfile or equivalent when there is one.
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index ee59efe..3346d64 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -55,9 +55,9 @@
     int null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY));
     ASSERT(null_fd >= 0);
     VOID_TEMP_FAILURE_RETRY(dup2(null_fd, handle_->fd()));
-    VOID_TEMP_FAILURE_RETRY(close(null_fd));
+    close(null_fd);
   } else {
-    int err = TEMP_FAILURE_RETRY(close(handle_->fd()));
+    int err = close(handle_->fd());
     if (err != 0) {
       const int kBufferSize = 1024;
       char error_buf[kBufferSize];
@@ -396,7 +396,7 @@
       openat64(newns.fd(), newns.path(),
                O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, st.st_mode));
   if (new_fd < 0) {
-    VOID_TEMP_FAILURE_RETRY(close(old_fd));
+    close(old_fd);
     return false;
   }
   int64_t offset = 0;
@@ -421,8 +421,8 @@
     }
   }
   int e = errno;
-  VOID_TEMP_FAILURE_RETRY(close(old_fd));
-  VOID_TEMP_FAILURE_RETRY(close(new_fd));
+  close(old_fd);
+  close(new_fd);
   if (result < 0) {
     VOID_NO_RETRY_EXPECTED(unlinkat(newns.fd(), newns.path(), 0));
     errno = e;
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 244838f..3320491 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -55,9 +55,9 @@
     intptr_t null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY));
     ASSERT(null_fd >= 0);
     VOID_TEMP_FAILURE_RETRY(dup2(null_fd, handle_->fd()));
-    VOID_TEMP_FAILURE_RETRY(close(null_fd));
+    close(null_fd);
   } else {
-    intptr_t err = TEMP_FAILURE_RETRY(close(handle_->fd()));
+    intptr_t err = close(handle_->fd());
     if (err != 0) {
       const int kBufferSize = 1024;
       char error_message[kBufferSize];
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index 635a8d1..770ed06 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -75,7 +75,7 @@
 
     ~Node() {
       Stop();
-      VOID_TEMP_FAILURE_RETRY(close(write_fd_));
+      close(write_fd_);
       CFRelease(path_ref_);
     }
 
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
index e23dadd..54c1f3b 100644
--- a/runtime/bin/process_android.cc
+++ b/runtime/bin/process_android.cc
@@ -46,7 +46,7 @@
  public:
   ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
-    int closed = TEMP_FAILURE_RETRY(close(fd_));
+    int closed = close(fd_);
     if (closed != 0) {
       FATAL("Failed to close process exit code pipe");
     }
@@ -338,14 +338,14 @@
     }
 
     // Read the result of executing the child process.
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
     exec_control_[1] = -1;
     if (Process::ModeIsAttached(mode_)) {
       err = ReadExecResult();
     } else {
       err = ReadDetachedExecResult(&pid);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
+    close(exec_control_[0]);
     exec_control_[0] = -1;
 
     // Return error code if any failures.
@@ -356,7 +356,7 @@
         // GetProcessExitCodes will get a broken pipe error when it
         // tries to write to the writing side of the pipe and it will
         // ignore the error.
-        VOID_TEMP_FAILURE_RETRY(close(*exit_event_));
+        close(*exit_event_);
         *exit_event_ = -1;
       }
       CloseAllPipes();
@@ -367,17 +367,17 @@
       // Connect stdio, stdout and stderr.
       FDUtils::SetNonBlocking(read_in_[0]);
       *in_ = read_in_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       FDUtils::SetNonBlocking(write_out_[1]);
       *out_ = write_out_[1];
-      VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+      close(write_out_[0]);
       FDUtils::SetNonBlocking(read_err_[0]);
       *err_ = read_err_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+      close(read_err_[1]);
     } else {
       // Close all fds.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[0]);
+      close(read_in_[1]);
       ASSERT(write_out_[0] == -1);
       ASSERT(write_out_[1] == -1);
       ASSERT(read_err_[0] == -1);
@@ -514,9 +514,9 @@
       ASSERT(read_err_[1] == -1);
       // For a detached process the pipe to connect stdout is only used for
       // signaling when to do the first fork.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
+      close(read_in_[0]);
       read_in_[0] = -1;
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       read_in_[1] = -1;
     } else {
       // Don't close any fds if keeping stdio open to the detached process.
@@ -632,7 +632,7 @@
     }
     for (int fd = 0; fd < max_fds; fd++) {
       if (fd != exec_control_[1]) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
@@ -664,24 +664,24 @@
     for (int fd = 0; fd < max_fds; fd++) {
       if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
           (fd != read_in_[1]) && (fd != read_err_[1])) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
     if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+    close(write_out_[0]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+    close(read_in_[1]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+    close(read_err_[1]);
   }
 
   int CleanupAndReturnError() {
@@ -716,7 +716,7 @@
       FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
                                strlen(os_error_message) + 1);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
 
     // We avoid running through registered atexit() handlers because that is
     // unnecessary work.
@@ -748,7 +748,7 @@
   void ClosePipe(int* fds) {
     for (int i = 0; i < 2; i++) {
       if (fds[i] != -1) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i]));
+        close(fds[i]);
         fds[i] = -1;
       }
     }
@@ -806,9 +806,9 @@
 
 static bool CloseProcessBuffers(struct pollfd fds[3]) {
   int e = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fds[0].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[1].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[2].fd));
+  close(fds[0].fd);
+  close(fds[1].fd);
+  close(fds[2].fd);
   errno = e;
   return false;
 }
@@ -820,7 +820,7 @@
                    intptr_t exit_event,
                    ProcessResult* result) {
   // Close input to the process right away.
-  VOID_TEMP_FAILURE_RETRY(close(in));
+  close(in);
 
   // There is no return from this function using Dart_PropagateError
   // as memory used by the buffer lists is freed through their
@@ -874,7 +874,7 @@
         }
       }
       if ((fds[i].revents & POLLHUP) != 0) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i].fd));
+        close(fds[i].fd);
         alive--;
         if (i < alive) {
           fds[i] = fds[alive];
@@ -955,7 +955,7 @@
 };
 
 SignalInfo::~SignalInfo() {
-  VOID_TEMP_FAILURE_RETRY(close(fd_));
+  close(fd_);
 }
 
 static void SignalHandler(int signal) {
@@ -986,8 +986,8 @@
     return -1;
   }
   if (!FDUtils::SetNonBlocking(fds[0])) {
-    VOID_TEMP_FAILURE_RETRY(close(fds[0]));
-    VOID_TEMP_FAILURE_RETRY(close(fds[1]));
+    close(fds[0]);
+    close(fds[1]);
     return -1;
   }
   ThreadSignalBlocker blocker(kSignalsCount, kSignals);
@@ -1011,8 +1011,8 @@
     }
     int status = NO_RETRY_EXPECTED(sigaction(signal, &act, NULL));
     if (status < 0) {
-      VOID_TEMP_FAILURE_RETRY(close(fds[0]));
-      VOID_TEMP_FAILURE_RETRY(close(fds[1]));
+      close(fds[0]);
+      close(fds[1]);
       return -1;
     }
   }
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc
index ac15292..2da6e0c 100644
--- a/runtime/bin/process_fuchsia.cc
+++ b/runtime/bin/process_fuchsia.cc
@@ -581,7 +581,7 @@
         TEMP_FAILURE_RETRY(openat(ns.fd(), ns.path(), O_RDONLY));
     zx_handle_t vmo = ZX_HANDLE_INVALID;
     zx_status_t status = fdio_get_vmo_clone(pathfd, &vmo);
-    VOID_TEMP_FAILURE_RETRY(close(pathfd));
+    close(pathfd);
     if (status != ZX_OK) {
       close(exit_pipe_fds[0]);
       close(exit_pipe_fds[1]);
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index 6dfc3aa..98ab964 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -46,7 +46,7 @@
  public:
   ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
-    int closed = TEMP_FAILURE_RETRY(close(fd_));
+    int closed = close(fd_);
     if (closed != 0) {
       FATAL("Failed to close process exit code pipe");
     }
@@ -338,14 +338,14 @@
     }
 
     // Read the result of executing the child process.
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
     exec_control_[1] = -1;
     if (Process::ModeIsAttached(mode_)) {
       err = ReadExecResult();
     } else {
       err = ReadDetachedExecResult(&pid);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
+    close(exec_control_[0]);
     exec_control_[0] = -1;
 
     // Return error code if any failures.
@@ -356,7 +356,7 @@
         // GetProcessExitCodes will get a broken pipe error when it
         // tries to write to the writing side of the pipe and it will
         // ignore the error.
-        VOID_TEMP_FAILURE_RETRY(close(*exit_event_));
+        close(*exit_event_);
         *exit_event_ = -1;
       }
       CloseAllPipes();
@@ -367,17 +367,17 @@
       // Connect stdio, stdout and stderr.
       FDUtils::SetNonBlocking(read_in_[0]);
       *in_ = read_in_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       FDUtils::SetNonBlocking(write_out_[1]);
       *out_ = write_out_[1];
-      VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+      close(write_out_[0]);
       FDUtils::SetNonBlocking(read_err_[0]);
       *err_ = read_err_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+      close(read_err_[1]);
     } else {
       // Close all fds.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[0]);
+      close(read_in_[1]);
       ASSERT(write_out_[0] == -1);
       ASSERT(write_out_[1] == -1);
       ASSERT(read_err_[0] == -1);
@@ -514,9 +514,9 @@
       ASSERT(read_err_[1] == -1);
       // For a detached process the pipe to connect stdout is only used for
       // signaling when to do the first fork.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
+      close(read_in_[0]);
       read_in_[0] = -1;
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       read_in_[1] = -1;
     } else {
       // Don't close any fds if keeping stdio open to the detached process.
@@ -632,7 +632,7 @@
     }
     for (int fd = 0; fd < max_fds; fd++) {
       if (fd != exec_control_[1]) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
@@ -664,24 +664,24 @@
     for (int fd = 0; fd < max_fds; fd++) {
       if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
           (fd != read_in_[1]) && (fd != read_err_[1])) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
     if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+    close(write_out_[0]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+    close(read_in_[1]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+    close(read_err_[1]);
   }
 
   int CleanupAndReturnError() {
@@ -716,7 +716,7 @@
       FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
                                strlen(os_error_message) + 1);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
 
     // We avoid running through registered atexit() handlers because that is
     // unnecessary work.
@@ -748,7 +748,7 @@
   void ClosePipe(int* fds) {
     for (int i = 0; i < 2; i++) {
       if (fds[i] != -1) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i]));
+        close(fds[i]);
         fds[i] = -1;
       }
     }
@@ -806,9 +806,9 @@
 
 static bool CloseProcessBuffers(struct pollfd fds[3]) {
   int e = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fds[0].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[1].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[2].fd));
+  close(fds[0].fd);
+  close(fds[1].fd);
+  close(fds[2].fd);
   errno = e;
   return false;
 }
@@ -820,7 +820,7 @@
                    intptr_t exit_event,
                    ProcessResult* result) {
   // Close input to the process right away.
-  VOID_TEMP_FAILURE_RETRY(close(in));
+  close(in);
 
   // There is no return from this function using Dart_PropagateError
   // as memory used by the buffer lists is freed through their
@@ -874,7 +874,7 @@
         }
       }
       if ((fds[i].revents & POLLHUP) != 0) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i].fd));
+        close(fds[i].fd);
         alive--;
         if (i < alive) {
           fds[i] = fds[alive];
@@ -955,7 +955,7 @@
 };
 
 SignalInfo::~SignalInfo() {
-  VOID_TEMP_FAILURE_RETRY(close(fd_));
+  close(fd_);
 }
 
 static void SignalHandler(int signal) {
@@ -1007,8 +1007,8 @@
     int status = sigaction(signal, &act, NULL);
     if (status < 0) {
       int err = errno;
-      VOID_TEMP_FAILURE_RETRY(close(fds[0]));
-      VOID_TEMP_FAILURE_RETRY(close(fds[1]));
+      close(fds[0]);
+      close(fds[1]);
       errno = err;
       return -1;
     }
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index e8cb286..830705c 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -45,7 +45,7 @@
  public:
   ProcessInfo(pid_t pid, intptr_t fd) : pid_(pid), fd_(fd) {}
   ~ProcessInfo() {
-    int closed = TEMP_FAILURE_RETRY(close(fd_));
+    int closed = close(fd_);
     if (closed != 0) {
       FATAL("Failed to close process exit code pipe");
     }
@@ -332,14 +332,14 @@
     }
 
     // Read the result of executing the child process.
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
     exec_control_[1] = -1;
     if (Process::ModeIsAttached(mode_)) {
       err = ReadExecResult();
     } else {
       err = ReadDetachedExecResult(&pid);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[0]));
+    close(exec_control_[0]);
     exec_control_[0] = -1;
 
     // Return error code if any failures.
@@ -350,7 +350,7 @@
         // GetProcessExitCodes will get a broken pipe error when it
         // tries to write to the writing side of the pipe and it will
         // ignore the error.
-        VOID_TEMP_FAILURE_RETRY(close(*exit_event_));
+        close(*exit_event_);
         *exit_event_ = -1;
       }
       CloseAllPipes();
@@ -361,17 +361,17 @@
       // Connect stdio, stdout and stderr.
       FDUtils::SetNonBlocking(read_in_[0]);
       *in_ = read_in_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       FDUtils::SetNonBlocking(write_out_[1]);
       *out_ = write_out_[1];
-      VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+      close(write_out_[0]);
       FDUtils::SetNonBlocking(read_err_[0]);
       *err_ = read_err_[0];
-      VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+      close(read_err_[1]);
     } else {
       // Close all fds.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[0]);
+      close(read_in_[1]);
       ASSERT(write_out_[0] == -1);
       ASSERT(write_out_[1] == -1);
       ASSERT(read_err_[0] == -1);
@@ -483,9 +483,9 @@
       ASSERT(read_err_[1] == -1);
       // For a detached process the pipe to connect stdout is only used for
       // signaling when to do the first fork.
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[0]));
+      close(read_in_[0]);
       read_in_[0] = -1;
-      VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+      close(read_in_[1]);
       read_in_[1] = -1;
     } else {
       // Don't close any fds if keeping stdio open to the detached process.
@@ -597,7 +597,7 @@
     }
     for (int fd = 0; fd < max_fds; fd++) {
       if (fd != exec_control_[1]) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
@@ -629,24 +629,24 @@
     for (int fd = 0; fd < max_fds; fd++) {
       if ((fd != exec_control_[1]) && (fd != write_out_[0]) &&
           (fd != read_in_[1]) && (fd != read_err_[1])) {
-        VOID_TEMP_FAILURE_RETRY(close(fd));
+        close(fd);
       }
     }
 
     if (TEMP_FAILURE_RETRY(dup2(write_out_[0], STDIN_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(write_out_[0]));
+    close(write_out_[0]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_in_[1], STDOUT_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_in_[1]));
+    close(read_in_[1]);
 
     if (TEMP_FAILURE_RETRY(dup2(read_err_[1], STDERR_FILENO)) == -1) {
       ReportChildError();
     }
-    VOID_TEMP_FAILURE_RETRY(close(read_err_[1]));
+    close(read_err_[1]);
   }
 
   int CleanupAndReturnError() {
@@ -681,7 +681,7 @@
       FDUtils::WriteToBlocking(exec_control_[1], os_error_message,
                                strlen(os_error_message) + 1);
     }
-    VOID_TEMP_FAILURE_RETRY(close(exec_control_[1]));
+    close(exec_control_[1]);
     exit(1);
   }
 
@@ -710,7 +710,7 @@
   void ClosePipe(int* fds) {
     for (int i = 0; i < 2; i++) {
       if (fds[i] != -1) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i]));
+        close(fds[i]);
         fds[i] = -1;
       }
     }
@@ -767,9 +767,9 @@
 
 static bool CloseProcessBuffers(struct pollfd fds[3]) {
   int e = errno;
-  VOID_TEMP_FAILURE_RETRY(close(fds[0].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[1].fd));
-  VOID_TEMP_FAILURE_RETRY(close(fds[2].fd));
+  close(fds[0].fd);
+  close(fds[1].fd);
+  close(fds[2].fd);
   errno = e;
   return false;
 }
@@ -781,7 +781,7 @@
                    intptr_t exit_event,
                    ProcessResult* result) {
   // Close input to the process right away.
-  VOID_TEMP_FAILURE_RETRY(close(in));
+  close(in);
 
   // There is no return from this function using Dart_PropagateError
   // as memory used by the buffer lists is freed through their
@@ -841,7 +841,7 @@
       }
       if (((fds[i].revents & POLLHUP) != 0) ||
           (((fds[i].revents & POLLIN) != 0) && (avail == 0))) {
-        VOID_TEMP_FAILURE_RETRY(close(fds[i].fd));
+        close(fds[i].fd);
         alive--;
         if (i < alive) {
           fds[i] = fds[alive];
@@ -974,7 +974,7 @@
 };
 
 SignalInfo::~SignalInfo() {
-  VOID_TEMP_FAILURE_RETRY(close(fd_));
+  close(fd_);
 }
 
 static void SignalHandler(int signal) {
@@ -1010,8 +1010,8 @@
   }
   if (!FDUtils::SetCloseOnExec(fds[0]) || !FDUtils::SetCloseOnExec(fds[1]) ||
       !FDUtils::SetNonBlocking(fds[0])) {
-    VOID_TEMP_FAILURE_RETRY(close(fds[0]));
-    VOID_TEMP_FAILURE_RETRY(close(fds[1]));
+    close(fds[0]);
+    close(fds[1]);
     return -1;
   }
   ThreadSignalBlocker blocker(kSignalsCount, kSignals);
@@ -1035,8 +1035,8 @@
     }
     intptr_t status = NO_RETRY_EXPECTED(sigaction(signal, &act, NULL));
     if (status < 0) {
-      VOID_TEMP_FAILURE_RETRY(close(fds[0]));
-      VOID_TEMP_FAILURE_RETRY(close(fds[1]));
+      close(fds[0]);
+      close(fds[1]);
       return -1;
     }
   }
diff --git a/runtime/bin/socket_base_android.cc b/runtime/bin/socket_base_android.cc
index 83f400b..084ab2f 100644
--- a/runtime/bin/socket_base_android.cc
+++ b/runtime/bin/socket_base_android.cc
@@ -260,7 +260,7 @@
 
 void SocketBase::Close(intptr_t fd) {
   ASSERT(fd >= 0);
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
 }
 
 bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
diff --git a/runtime/bin/socket_base_linux.cc b/runtime/bin/socket_base_linux.cc
index 2e6b461..87aedbd 100644
--- a/runtime/bin/socket_base_linux.cc
+++ b/runtime/bin/socket_base_linux.cc
@@ -301,7 +301,7 @@
 
 void SocketBase::Close(intptr_t fd) {
   ASSERT(fd >= 0);
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
 }
 
 bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
diff --git a/runtime/bin/socket_base_macos.cc b/runtime/bin/socket_base_macos.cc
index 4a53bac..a448911 100644
--- a/runtime/bin/socket_base_macos.cc
+++ b/runtime/bin/socket_base_macos.cc
@@ -291,7 +291,7 @@
 
 void SocketBase::Close(intptr_t fd) {
   ASSERT(fd >= 0);
-  VOID_TEMP_FAILURE_RETRY(close(fd));
+  close(fd);
 }
 
 bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {