// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include #include #include "base/check.h" #include "base/posix/eintr_wrapper.h" #include "media/base/scopedfd_helper.h" namespace media { std::vector DuplicateFDs( const std::vector& fds) { std::vector ret; for (auto& fd : fds) { base::ScopedFD dup_fd = base::ScopedFD(HANDLE_EINTR(dup(fd.get()))); PCHECK(dup_fd.is_valid()); ret.push_back(std::move(dup_fd)); } return ret; } } // namespace media