OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
7 | 7 |
8 #include "bin/fdutils.h" | 8 #include "bin/fdutils.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return -1; | 130 return -1; |
131 } else { | 131 } else { |
132 ASSERT(bytes_written > 0); | 132 ASSERT(bytes_written > 0); |
133 remaining -= bytes_written; | 133 remaining -= bytes_written; |
134 buffer_pos += bytes_written; | 134 buffer_pos += bytes_written; |
135 } | 135 } |
136 } | 136 } |
137 return count; | 137 return count; |
138 } | 138 } |
139 | 139 |
| 140 |
| 141 void FDUtils::SaveErrorAndClose(intptr_t fd) { |
| 142 int err = errno; |
| 143 VOID_TEMP_FAILURE_RETRY(close(fd)); |
| 144 errno = err; |
| 145 } |
| 146 |
140 } // namespace bin | 147 } // namespace bin |
141 } // namespace dart | 148 } // namespace dart |
142 | 149 |
143 #endif // defined(TARGET_OS_MACOS) | 150 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |