Loading system/vendor_libs/test_vendor_lib/desktop/test_environment.cc +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <fcntl.h> #include <netdb.h> #include <netinet/in.h> #include <signal.h> #include <string.h> #include <unistd.h> Loading Loading @@ -48,6 +49,11 @@ void TestEnvironment::initialize(std::promise<void> barrier) { SetUpHciServer([this](int fd) { test_model_.IncomingHciConnection(fd); }); SetUpLinkLayerServer([this](int fd) { test_model_.IncomingLinkLayerConnection(fd); }); // In case the client socket is closed, and rootcanal doesn't detect it due to // TimerTick not fired, writing to the socket causes a SIGPIPE and we need to // catch it to prevent rootcanal from crash signal(SIGPIPE, SIG_IGN); LOG_INFO("%s: Finished", __func__); } Loading system/vendor_libs/test_vendor_lib/model/devices/h4_packetizer.cc +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,9 @@ void H4Packetizer::OnDataReady(int fd) { if (errno == EAGAIN) { // No data, try again later. return; } else if (errno == ECONNRESET) { // They probably rejected our packet return; } else { LOG_ALWAYS_FATAL("%s: Read packet type error: %s", __func__, strerror(errno)); } Loading Loading
system/vendor_libs/test_vendor_lib/desktop/test_environment.cc +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <fcntl.h> #include <netdb.h> #include <netinet/in.h> #include <signal.h> #include <string.h> #include <unistd.h> Loading Loading @@ -48,6 +49,11 @@ void TestEnvironment::initialize(std::promise<void> barrier) { SetUpHciServer([this](int fd) { test_model_.IncomingHciConnection(fd); }); SetUpLinkLayerServer([this](int fd) { test_model_.IncomingLinkLayerConnection(fd); }); // In case the client socket is closed, and rootcanal doesn't detect it due to // TimerTick not fired, writing to the socket causes a SIGPIPE and we need to // catch it to prevent rootcanal from crash signal(SIGPIPE, SIG_IGN); LOG_INFO("%s: Finished", __func__); } Loading
system/vendor_libs/test_vendor_lib/model/devices/h4_packetizer.cc +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,9 @@ void H4Packetizer::OnDataReady(int fd) { if (errno == EAGAIN) { // No data, try again later. return; } else if (errno == ECONNRESET) { // They probably rejected our packet return; } else { LOG_ALWAYS_FATAL("%s: Read packet type error: %s", __func__, strerror(errno)); } Loading