Loading DnsTlsSocket.cpp +7 −5 Original line number Original line Diff line number Diff line Loading @@ -449,16 +449,18 @@ bool DnsTlsSocket::query(uint16_t id, const Slice query) { } } void DnsTlsSocket::requestLoopShutdown() { void DnsTlsSocket::requestLoopShutdown() { if (mEventFd != -1) { // Write a negative number to the eventfd. This triggers an immediate shutdown. // Write a negative number to the eventfd. This triggers an immediate shutdown. incrementEventFd(INT64_MIN); incrementEventFd(INT64_MIN); } } } bool DnsTlsSocket::incrementEventFd(const int64_t count) { bool DnsTlsSocket::incrementEventFd(const int64_t count) { if (!mEventFd) { if (mEventFd == -1) { ALOGV("eventfd is not initialized"); ALOGE("eventfd is not initialized"); return false; return false; } } int written = write(mEventFd.get(), &count, sizeof(count)); ssize_t written = write(mEventFd.get(), &count, sizeof(count)); if (written != sizeof(count)) { if (written != sizeof(count)) { ALOGE("Failed to increment eventfd by %" PRId64, count); ALOGE("Failed to increment eventfd by %" PRId64, count); return false; return false; Loading Loading
DnsTlsSocket.cpp +7 −5 Original line number Original line Diff line number Diff line Loading @@ -449,16 +449,18 @@ bool DnsTlsSocket::query(uint16_t id, const Slice query) { } } void DnsTlsSocket::requestLoopShutdown() { void DnsTlsSocket::requestLoopShutdown() { if (mEventFd != -1) { // Write a negative number to the eventfd. This triggers an immediate shutdown. // Write a negative number to the eventfd. This triggers an immediate shutdown. incrementEventFd(INT64_MIN); incrementEventFd(INT64_MIN); } } } bool DnsTlsSocket::incrementEventFd(const int64_t count) { bool DnsTlsSocket::incrementEventFd(const int64_t count) { if (!mEventFd) { if (mEventFd == -1) { ALOGV("eventfd is not initialized"); ALOGE("eventfd is not initialized"); return false; return false; } } int written = write(mEventFd.get(), &count, sizeof(count)); ssize_t written = write(mEventFd.get(), &count, sizeof(count)); if (written != sizeof(count)) { if (written != sizeof(count)) { ALOGE("Failed to increment eventfd by %" PRId64, count); ALOGE("Failed to increment eventfd by %" PRId64, count); return false; return false; Loading