Index: runtime/bin/fdutils_linux.cc |
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc |
index 5a174ee151ca4dbb33754f7c98faabc96c4f91aa..7f4598bcc793b900b25f9b3f33a2bf067069f5b0 100644 |
--- a/runtime/bin/fdutils_linux.cc |
+++ b/runtime/bin/fdutils_linux.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 |