Index: runtime/bin/fdutils_macos.cc |
diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc |
index ab1a603e91277fdcd66180bbeffb4f60cd5bf46c..4a0e3c09c8864fa14e93b8b6f7e315b77a1a67ef 100644 |
--- a/runtime/bin/fdutils_macos.cc |
+++ b/runtime/bin/fdutils_macos.cc |
@@ -137,6 +137,13 @@ ssize_t FDUtils::WriteToBlocking(int fd, const void* buffer, size_t count) { |
return count; |
} |
+ |
+void FDUtils::SaveErrorAndClose(intptr_t fd) { |
+ int err = errno; |
+ VOID_TEMP_FAILURE_RETRY(close(fd)); |
+ errno = err; |
+} |
+ |
} // namespace bin |
} // namespace dart |