OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_descriptor_shuffle.h" | 5 #include "base/file_descriptor_shuffle.h" |
6 | 6 |
7 #include <errno.h> | |
8 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #include <stddef.h> |
| 9 #include <ostream> |
9 | 10 |
10 #include "base/eintr_wrapper.h" | 11 #include "base/eintr_wrapper.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 | 15 |
15 bool PerformInjectiveMultimapDestructive( | 16 bool PerformInjectiveMultimapDestructive( |
16 InjectiveMultimap* m, InjectionDelegate* delegate) { | 17 InjectiveMultimap* m, InjectionDelegate* delegate) { |
17 static const size_t kMaxExtraFDs = 16; | 18 static const size_t kMaxExtraFDs = 16; |
18 int extra_fds[kMaxExtraFDs]; | 19 int extra_fds[kMaxExtraFDs]; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 bool FileDescriptorTableInjection::Move(int src, int dest) { | 87 bool FileDescriptorTableInjection::Move(int src, int dest) { |
87 return HANDLE_EINTR(dup2(src, dest)) != -1; | 88 return HANDLE_EINTR(dup2(src, dest)) != -1; |
88 } | 89 } |
89 | 90 |
90 void FileDescriptorTableInjection::Close(int fd) { | 91 void FileDescriptorTableInjection::Close(int fd) { |
91 int ret = HANDLE_EINTR(close(fd)); | 92 int ret = HANDLE_EINTR(close(fd)); |
92 DPCHECK(ret == 0); | 93 DPCHECK(ret == 0); |
93 } | 94 } |
94 | 95 |
95 } // namespace base | 96 } // namespace base |
OLD | NEW |