summaryrefslogtreecommitdiff
path: root/source/Utility/SelectHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Utility/SelectHelper.cpp')
-rw-r--r--source/Utility/SelectHelper.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/source/Utility/SelectHelper.cpp b/source/Utility/SelectHelper.cpp
index 2979a67dc182c..ff21d99e400ab 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>(