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

Commit 5fcb584d authored by Myles Watson's avatar Myles Watson Committed by Ajay Panicker
Browse files

test_vendor: Use pipe2 to set pipe flags

Simplify the code to fix a typo.  F_SETFD should have been
F_SETFL.

Test: run unit tests

out/host/linux-x86/nativetest/test-vendor_test_host/test-vendor_test_host \
        --gtest_filter=AsyncManagerSocketTest.*

Change-Id: I215381d6e130428acae7d73d80fefc97cbf64651
parent c2961fa1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ class AsyncManager::AsyncFdWatcher {
    }
    // set up the communication channel
    int pipe_fds[2];
    if (pipe(pipe_fds)) {
    if (pipe2(pipe_fds, O_NONBLOCK)) {
      LOG_ERROR(LOG_TAG,
                "%s:Unable to establish a communication channel to the reading "
                "thread",
@@ -168,8 +168,6 @@ class AsyncManager::AsyncFdWatcher {
    }
    notification_listen_fd_ = pipe_fds[0];
    notification_write_fd_ = pipe_fds[1];
    TEMP_FAILURE_RETRY(fcntl(notification_listen_fd_, F_SETFD, O_NONBLOCK));
    TEMP_FAILURE_RETRY(fcntl(notification_write_fd_, F_SETFD, O_NONBLOCK));

    thread_ = std::thread([this]() { ThreadRoutine(); });
    if (!thread_.joinable()) {