Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "remoting/host/setup/pipe.h" | |
| 6 | |
| 7 #if defined(OS_WIN) | |
| 8 #include <windows.h> | |
| 9 #elif defined(OS_POSIX) | |
| 10 #include <unistd.h> | |
| 11 #endif | |
| 12 | |
| 13 namespace remoting { | |
| 14 | |
| 15 bool MakePipe(base::PlatformFile* read_handle, | |
| 16 base::PlatformFile* write_handle) { | |
| 17 #if defined(OS_WIN) | |
| 18 return CreatePipe(read_handle, write_handle, NULL, 0) != FALSE; | |
|
Sergey Ulanov
2013/05/29 19:54:43
FYI: Anonymous pipes on windows may have different
Lambros
2013/05/29 23:50:22
ok thanks for the info, I'll keep as-is.
| |
| 19 #elif defined(OS_POSIX) | |
| 20 int fds[2]; | |
| 21 if (pipe(fds) == 0) { | |
| 22 *read_handle = fds[0]; | |
| 23 *write_handle = fds[1]; | |
| 24 return true; | |
| 25 } | |
| 26 return false; | |
| 27 #else | |
| 28 #error Not implemented | |
| 29 #endif | |
| 30 } | |
| 31 | |
| 32 } // namepsace remoting | |
| OLD | NEW |