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

Commit e546f681 authored by Josh Gao's avatar Josh Gao
Browse files

adb: fdevent: delete FDE_CREATED.

All fdevents must be created by fdevent_create/fdevent_context::Create
now, so this flag is meaningless.

Test: none
Change-Id: I8489afad07bdb267ddfdb0dbb25d40d3a62f55f6
parent 95eef6b0
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -33,9 +33,6 @@ std::string dump_fde(const fdevent* fde) {
    if (fde->state & FDE_PENDING) {
        state += "P";
    }
    if (fde->state & FDE_CREATED) {
        state += "C";
    }
    if (fde->state & FDE_READ) {
        state += "R";
    }
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@

#define FDE_ACTIVE     0x0100
#define FDE_PENDING    0x0200
#define FDE_CREATED    0x0400

typedef void (*fd_func)(int fd, unsigned events, void *userdata);
typedef void (*fd_func2)(struct fdevent* fde, unsigned events, void* userdata);
+0 −5
Original line number Diff line number Diff line
@@ -105,7 +105,6 @@ fdevent* fdevent_context_poll::Create(unique_fd fd, std::variant<fd_func, fd_fun
    auto pair = poll_node_map_.emplace(fde->fd.get(), PollNode(fde));
    CHECK(pair.second) << "install existing fd " << fde->fd.get();

    fde->state |= FDE_CREATED;
    return fde;
}

@@ -115,10 +114,6 @@ unique_fd fdevent_context_poll::Destroy(fdevent* fde) {
        return {};
    }

    if (!(fde->state & FDE_CREATED)) {
        LOG(FATAL) << "destroying fde not created by fdevent_create(): " << dump_fde(fde);
    }

    unique_fd result = std::move(fde->fd);
    if (fde->state & FDE_ACTIVE) {
        poll_node_map_.erase(result.get());