Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df47019a authored by Wei Wang's avatar Wei Wang Committed by android-build-merger
Browse files

Merge "init: don't wait if we have more work to do" am: 32ee9fc2

am: c746ecbc

Change-Id: I25e011de5ae99fdda1e4c0c88d6de9056ea8189a
parents 093f9b7a c746ecbc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -731,15 +731,15 @@ int main(int argc, char** argv) {
        // By default, sleep until something happens.
        int epoll_timeout_ms = -1;

        // If there's more work to do, wake up again immediately.
        if (am.HasMoreCommands()) epoll_timeout_ms = 0;

        // If there's a process that needs restarting, wake up in time for that.
        if (process_needs_restart_at != 0) {
            epoll_timeout_ms = (process_needs_restart_at - time(nullptr)) * 1000;
            if (epoll_timeout_ms < 0) epoll_timeout_ms = 0;
        }

        // If there's more work to do, wake up again immediately.
        if (am.HasMoreCommands()) epoll_timeout_ms = 0;

        bootchart_sample(&epoll_timeout_ms);

        epoll_event ev;