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

Commit de71c6f7 authored by Steven Moreland's avatar Steven Moreland
Browse files

InputTransport: print FD in fatal error

This error can be used to kill input flinger, and
the calling code should be changed as well.

Bug: 301519740
Test: w/ fuzzer, determined FD in bad state was '-1'
Change-Id: I331d900eed0a73fd483ae25fd6a2f6d36f57c48a
parent b2361af7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -327,8 +327,8 @@ std::unique_ptr<InputChannel> InputChannel::create(const std::string& name,
                                                   android::base::unique_fd fd, sp<IBinder> token) {
    const int result = fcntl(fd, F_SETFL, O_NONBLOCK);
    if (result != 0) {
        LOG_ALWAYS_FATAL("channel '%s' ~ Could not make socket non-blocking: %s", name.c_str(),
                         strerror(errno));
        LOG_ALWAYS_FATAL("channel '%s' ~ Could not make socket (%d) non-blocking: %s", name.c_str(),
                         fd.get(), strerror(errno));
        return nullptr;
    }
    // using 'new' to access a non-public constructor