commit | b195cd1a03f13164e452acddea48ff448fb62c3c | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Thu Oct 25 00:24:56 2018 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Oct 25 00:24:56 2018 +0000 |
tree | 207dac04249dc8c2e934c32e2320feba68b9a41e | |
parent | 4c1021c342d40ceff6203499d4807d238cdd0a53 [diff] | |
parent | 400d817c0c0ad37b5a03abb4d34b9c1e24d49006 [diff] |
Merge "adb: Use a default _SC_GETPW_R_SIZE_MAX size"
diff --git a/adb/adb_utils.cpp b/adb/adb_utils.cpp index ad77064..6960345 100644 --- a/adb/adb_utils.cpp +++ b/adb/adb_utils.cpp
@@ -293,6 +293,9 @@ 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) {