Revert "init: poll in first stage mount if required devices are not found"
Bug: 62864413
This reverts commit 5f4e8eac8a0db87a43ed7a930103f4241c22d479.
Change-Id: I6f35b920bb52875c8ef430d3e20b205fda5165e8
diff --git a/init/devices.cpp b/init/devices.cpp
index 6f86662..27a20a4 100644
--- a/init/devices.cpp
+++ b/init/devices.cpp
@@ -19,7 +19,6 @@
#include <fcntl.h>
#include <fnmatch.h>
#include <libgen.h>
-#include <poll.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1029,37 +1028,6 @@
selinux_status_close();
}
-void device_poll(const coldboot_callback& callback,
- const std::optional<std::chrono::milliseconds> relative_timeout) {
- using namespace std::chrono;
-
- pollfd ufd;
- ufd.events = POLLIN;
- ufd.fd = device_fd;
-
- auto start_time = steady_clock::now();
-
- while (true) {
- ufd.revents = 0;
-
- int timeout_ms = -1;
- if (relative_timeout) {
- auto now = steady_clock::now();
- auto time_elapsed = duration_cast<milliseconds>(now - start_time);
- if (time_elapsed > *relative_timeout) return;
-
- auto remaining_timeout = *relative_timeout - time_elapsed;
- timeout_ms = remaining_timeout.count();
- }
-
- int nr = poll(&ufd, 1, timeout_ms);
- if (nr == 0) return;
- if (nr < 0) {
- continue;
- }
- if (ufd.revents & POLLIN) {
- auto ret = handle_device_fd(callback);
- if (should_stop_coldboot(ret)) return;
- }
- }
+int get_device_fd() {
+ return device_fd;
}