Chromium Code Reviews| Index: chrome/nacl/nacl_listener.cc |
| diff --git a/chrome/nacl/nacl_listener.cc b/chrome/nacl/nacl_listener.cc |
| index bb8eea550911aaac0fa8ab1709a2a0a27b60b230..2bf3a0e995e3a61c24f65f3132c29a2fb7ba89d2 100644 |
| --- a/chrome/nacl/nacl_listener.cc |
| +++ b/chrome/nacl/nacl_listener.cc |
| @@ -238,16 +238,20 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| NaClHandle irt_handle = nacl::ToNativeHandle(handles[handles.size() - 1]); |
| handles.pop_back(); |
| + if (params.uses_irt) { |
| #if defined(OS_WIN) |
| - args->irt_fd = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle), |
| - _O_RDONLY | _O_BINARY); |
| - if (args->irt_fd < 0) { |
| - LOG(ERROR) << "_open_osfhandle() failed"; |
| - return; |
| - } |
| + args->irt_fd = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle), |
| + _O_RDONLY | _O_BINARY); |
| + if (args->irt_fd < 0) { |
| + LOG(ERROR) << "_open_osfhandle() failed"; |
| + return; |
| + } |
| #else |
| - args->irt_fd = irt_handle; |
| + args->irt_fd = irt_handle; |
| #endif |
| + } else { |
| + args->irt_fd = -1; |
|
Mark Seaborn
2013/01/04 00:05:41
Maybe comment that the IRT FD/handle remains open
jvoung (off chromium)
2013/01/04 00:29:42
Or how about avoid sending the handle in the first
|
| + } |
| if (params.validation_cache_enabled) { |
| // SHA256 block size. |