mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[cscore, wpilibcExamples] Use double-quote includes for wpi/ (#8346)
Use ERR and WARN in cscore to avoid conflict with Windows headers.
This commit is contained in:
@@ -70,15 +70,14 @@ void NetworkListener::Impl::Thread::Main() {
|
||||
// Create event socket so we can be shut down
|
||||
m_command_fd = ::eventfd(0, 0);
|
||||
if (m_command_fd < 0) {
|
||||
ERROR("NetworkListener: could not create eventfd: {}",
|
||||
std::strerror(errno));
|
||||
ERR("NetworkListener: could not create eventfd: {}", std::strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
// Create netlink socket
|
||||
int sd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||
if (sd < 0) {
|
||||
ERROR("NetworkListener: could not create socket: {}", std::strerror(errno));
|
||||
ERR("NetworkListener: could not create socket: {}", std::strerror(errno));
|
||||
::close(m_command_fd);
|
||||
m_command_fd = -1;
|
||||
return;
|
||||
@@ -91,7 +90,7 @@ void NetworkListener::Impl::Thread::Main() {
|
||||
addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
|
||||
// NOLINTNEXTLINE(modernize-avoid-bind)
|
||||
if (bind(sd, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr)) < 0) {
|
||||
ERROR("NetworkListener: could not create socket: {}", std::strerror(errno));
|
||||
ERR("NetworkListener: could not create socket: {}", std::strerror(errno));
|
||||
::close(sd);
|
||||
::close(m_command_fd);
|
||||
m_command_fd = -1;
|
||||
@@ -114,7 +113,7 @@ void NetworkListener::Impl::Thread::Main() {
|
||||
int nfds = std::max(m_command_fd, sd) + 1;
|
||||
|
||||
if (::select(nfds, &readfds, nullptr, nullptr, &tv) < 0) {
|
||||
ERROR("NetworkListener: select(): {}", std::strerror(errno));
|
||||
ERR("NetworkListener: select(): {}", std::strerror(errno));
|
||||
break; // XXX: is this the right thing to do here?
|
||||
}
|
||||
|
||||
@@ -135,8 +134,7 @@ void NetworkListener::Impl::Thread::Main() {
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN) {
|
||||
continue;
|
||||
}
|
||||
ERROR("NetworkListener: could not read netlink: {}",
|
||||
std::strerror(errno));
|
||||
ERR("NetworkListener: could not read netlink: {}", std::strerror(errno));
|
||||
break; // XXX: is this the right thing to do here?
|
||||
}
|
||||
if (len == 0) {
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <wpi/net/EventLoopRunner.hpp>
|
||||
#include <wpi/net/uv/FsEvent.hpp>
|
||||
#include <wpi/net/uv/Timer.hpp>
|
||||
|
||||
#include "Notifier.hpp"
|
||||
#include "wpi/net/EventLoopRunner.hpp"
|
||||
#include "wpi/net/uv/FsEvent.hpp"
|
||||
#include "wpi/net/uv/Timer.hpp"
|
||||
#include "wpi/util/StringExtras.hpp"
|
||||
|
||||
using namespace wpi::cs;
|
||||
|
||||
Reference in New Issue
Block a user