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

Commit 220c45f9 authored by Narayan Kamath's avatar Narayan Kamath Committed by android-build-merger
Browse files

Merge "installd: remove spammy warning for non-existent profile dirs." into nyc-dev am: 5dda72b2

am: 5d411b5a

* commit '5d411b5a':
  installd: remove spammy warning for non-existent profile dirs.

Change-Id: Ia50b8521e0d0226413f6203a6041a9174a5b23be
parents b49df1c8 5d411b5a
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1022,17 +1022,16 @@ static void close_all_fds(const std::vector<fd_t>& fds, const char* description)
}

static fd_t open_profile_dir(const std::string& profile_dir) {
    struct stat buffer;
    if (TEMP_FAILURE_RETRY(lstat(profile_dir.c_str(), &buffer)) == -1) {
        PLOG(ERROR) << "Failed to lstat profile_dir: " << profile_dir;
        return -1;
    }

    fd_t profile_dir_fd = TEMP_FAILURE_RETRY(open(profile_dir.c_str(),
            O_PATH | O_CLOEXEC | O_DIRECTORY | O_NOFOLLOW));
    if (profile_dir_fd < 0) {
        // In a multi-user environment, these directories can be created at
        // different points and it's possible we'll attempt to open a profile
        // dir before it exists.
        if (errno != ENOENT) {
            PLOG(ERROR) << "Failed to open profile_dir: " << profile_dir;
        }
    }
    return profile_dir_fd;
}