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

Commit 8a3a8392 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 am: cea4002b

am: d6c7ee7e

Change-Id: I97433036f44f749d192a2f9a95db0a9e0b483083
parents cb6aff40 d6c7ee7e
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) {