DO NOT MERGE: Revert "init: Add diagnostics for signalfd epoll failures."
This reverts commit 0fa7c40c4cf1597dd0cca1f60b5eef8fdf6168a3.
Reason for revert: Diagnostics no longer needed
Change-Id: I04e9bf73b89411f7092348f57bfe6eb7dfaa9fcb
diff --git a/init/epoll.cpp b/init/epoll.cpp
index 0580f86..74d8aac 100644
--- a/init/epoll.cpp
+++ b/init/epoll.cpp
@@ -23,8 +23,6 @@
#include <functional>
#include <map>
-#include <android-base/logging.h>
-
namespace android {
namespace init {
@@ -44,11 +42,8 @@
if (!events) {
return Error() << "Must specify events";
}
-
- Info info;
- info.events = events;
- info.handler = std::make_shared<decltype(handler)>(std::move(handler));
- auto [it, inserted] = epoll_handlers_.emplace(fd, std::move(info));
+ auto sp = std::make_shared<decltype(handler)>(std::move(handler));
+ auto [it, inserted] = epoll_handlers_.emplace(fd, std::move(sp));
if (!inserted) {
return Error() << "Cannot specify two epoll handlers for a given FD";
}
@@ -89,14 +84,8 @@
}
std::vector<std::shared_ptr<Handler>> pending_functions;
for (int i = 0; i < num_events; ++i) {
- auto& info = *reinterpret_cast<Info*>(ev[i].data.ptr);
- if ((info.events & (EPOLLIN | EPOLLPRI)) == (EPOLLIN | EPOLLPRI) &&
- (ev[i].events & EPOLLIN) != ev[i].events) {
- // This handler wants to know about exception events, and just got one.
- // Log something informational.
- LOG(ERROR) << "Received unexpected epoll event set: " << ev[i].events;
- }
- pending_functions.emplace_back(info.handler);
+ auto sp = *reinterpret_cast<std::shared_ptr<Handler>*>(ev[i].data.ptr);
+ pending_functions.emplace_back(std::move(sp));
}
return pending_functions;