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

Commit cea4002b authored by Robert Yang's avatar Robert Yang Committed by android-build-merger
Browse files

Merge "adb: Use a default _SC_GETPW_R_SIZE_MAX size"

am: 9b6da168

Change-Id: I70999e0de21c1542ff6eae15f464e3a1a522f843
parents 6f691264 9b6da168
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -293,6 +293,9 @@ std::string adb_get_homedir_path() {
    struct passwd pwent;
    struct passwd* result;
    int pwent_max = sysconf(_SC_GETPW_R_SIZE_MAX);
    if (pwent_max == -1) {
        pwent_max = 16384;
    }
    std::vector<char> buf(pwent_max);
    int rc = getpwuid_r(getuid(), &pwent, buf.data(), buf.size(), &result);
    if (rc == 0 && result) {