diff options
Diffstat (limited to 'ipc/file_descriptor_set_posix.cc')
-rw-r--r-- | ipc/file_descriptor_set_posix.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ipc/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc index 584efec..fc15c2d 100644 --- a/ipc/file_descriptor_set_posix.cc +++ b/ipc/file_descriptor_set_posix.cc @@ -126,6 +126,16 @@ void FileDescriptorSet::CommitAll() { consumed_descriptor_highwater_ = 0; } +void FileDescriptorSet::ReleaseFDsToClose(std::vector<int>* fds) { + for (std::vector<base::FileDescriptor>::iterator + i = descriptors_.begin(); i != descriptors_.end(); ++i) { + if (i->auto_close) + fds->push_back(i->fd); + } + descriptors_.clear(); + consumed_descriptor_highwater_ = 0; +} + void FileDescriptorSet::SetDescriptors(const int* buffer, unsigned count) { DCHECK(count <= kMaxDescriptorsPerMessage); DCHECK_EQ(descriptors_.size(), 0u); |