Chromium Code Reviews| Index: runtime/bin/fdutils_macos.cc |
| =================================================================== |
| --- runtime/bin/fdutils_macos.cc (revision 7293) |
| +++ runtime/bin/fdutils_macos.cc (working copy) |
| @@ -26,6 +26,22 @@ |
| } |
| +bool FDUtils::SetBlocking(intptr_t fd) { |
| + intptr_t status; |
| + status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFL)); |
| + if (status < 0) { |
| + perror("fcntl F_GETFL failed"); |
| + return false; |
| + } |
| + status = (status & ~O_NONBLOCK); |
| + if (TEMP_FAILURE_RETRY(fcntl(fd, F_SETFL, status)) < 0) { |
| + perror("fcntl F_SETFL failed"); |
| + return false; |
| + } |
| + return true; |
|
siva
2012/05/03 22:52:08
Ditto comment regarding re factoring this.
I wond
hausner
2012/05/03 23:52:00
I was wondering too. They probably have a differen
|
| +} |
| + |
| + |
| bool FDUtils::IsBlocking(intptr_t fd, bool* is_blocking) { |
| intptr_t status; |
| status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFL)); |