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

Commit b1d8b881 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "adb: check for and report inotify_init1 failure." am: 41ee55a8 am: 95a3a2fc

am: 22ce93df

Change-Id: Id1264323d851f6f59f24d3a0dbc23eb5bccc4d8a
parents 5d6ea5a9 22ce93df
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -388,7 +388,13 @@ static void adb_auth_inotify_update(int fd, unsigned fd_event, void*) {

static void adb_auth_inotify_init(const std::set<std::string>& paths) {
    LOG(INFO) << "adb_auth_inotify_init...";

    int infd = inotify_init1(IN_CLOEXEC | IN_NONBLOCK);
    if (infd < 0) {
        PLOG(ERROR) << "failed to create inotify fd";
        return;
    }

    for (const std::string& path : paths) {
        int wd = inotify_add_watch(infd, path.c_str(), IN_CREATE | IN_MOVED_TO);
        if (wd < 0) {