Address compiler warnings #10
Some checks failed
BlockStorage/repertory_osx/pipeline/head There was a failure building this commit
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good

This commit is contained in:
2023-10-30 19:33:18 -05:00
parent bb5a9f9737
commit f94196d865
4 changed files with 316 additions and 309 deletions

View File

@@ -30,6 +30,7 @@
#include "utils/native_file.hpp"
#include "utils/path_utils.hpp"
#include "utils/string_utils.hpp"
#include <limits>
namespace repertory::utils {
void calculate_allocation_size(bool directory, std::uint64_t file_size,
@@ -244,13 +245,19 @@ auto get_next_available_port(std::uint16_t first_port,
std::uint16_t &available_port) -> bool {
using namespace boost::asio;
using ip::tcp;
boost::system::error_code error_code;
do {
io_service svc;
boost::system::error_code error_code{};
while (first_port != 0U) {
io_service svc{};
tcp::acceptor acceptor(svc);
acceptor.open(tcp::v4(), error_code) ||
acceptor.bind({tcp::v4(), first_port}, error_code);
} while (error_code && (first_port++ < 65535U));
if (not error_code) {
break;
}
++first_port;
}
if (not error_code) {
available_port = first_port;