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

Commit 31f6067f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Retry on signal." into sc-dev am: 5fcb9484 am: 565dee9e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15132638

Change-Id: I9ec57079b91436f3857480df75c08169d3a5b72e
parents 307efc26 565dee9e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -133,8 +133,12 @@ static bool sendRequest(int fd, RequestType requestType, FileIdx fileIdx = -1,

static int waitForDataOrSignal(int fd, int event_fd) {
    struct pollfd pfds[2] = {{fd, POLLIN, 0}, {event_fd, POLLIN, 0}};
    // Wait indefinitely until either data is ready or stop signal is received
    // Wait until either data is ready or stop signal is received
    int res = poll(pfds, 2, PollTimeoutMs);
    if (res == -1 && errno == EINTR) {
        // Treat it the same as timeout and allow the caller to retry.
        return 0;
    }
    if (res <= 0) {
        return res;
    }