diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Utility/SelectHelper.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'source/Utility/SelectHelper.cpp')
-rw-r--r-- | source/Utility/SelectHelper.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/Utility/SelectHelper.cpp b/source/Utility/SelectHelper.cpp index 2979a67dc182..ff21d99e400a 100644 --- a/source/Utility/SelectHelper.cpp +++ b/source/Utility/SelectHelper.cpp @@ -1,9 +1,8 @@ //===-- SelectHelper.cpp ----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -133,9 +132,7 @@ lldb_private::Status SelectHelper::Select() { fd_set *read_fdset_ptr = nullptr; fd_set *write_fdset_ptr = nullptr; fd_set *error_fdset_ptr = nullptr; -//---------------------------------------------------------------------- // Initialize and zero out the fdsets -//---------------------------------------------------------------------- #if defined(__APPLE__) llvm::SmallVector<fd_set, 1> read_fdset; llvm::SmallVector<fd_set, 1> write_fdset; @@ -177,9 +174,7 @@ lldb_private::Status SelectHelper::Select() { error_fdset_ptr = &error_fdset; } #endif - //---------------------------------------------------------------------- // Set the FD bits in the fdsets for read/write/error - //---------------------------------------------------------------------- for (auto &pair : m_fd_map) { const lldb::socket_t fd = pair.first; @@ -193,17 +188,13 @@ lldb_private::Status SelectHelper::Select() { FD_SET(fd, error_fdset_ptr); } - //---------------------------------------------------------------------- // Setup our timeout time value if needed - //---------------------------------------------------------------------- struct timeval *tv_ptr = nullptr; struct timeval tv = {0, 0}; - while (1) { + while (true) { using namespace std::chrono; - //------------------------------------------------------------------ // Setup out relative timeout based on the end time if we have one - //------------------------------------------------------------------ if (m_end_time.hasValue()) { tv_ptr = &tv; const auto remaining_dur = duration_cast<microseconds>( |