commit | 9b6da168496808c63ea4d62eec7300b2f47e35ba | [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 | d4e20cd0f9557123d5519307dadcbee06b029495 [diff] | |
parent | 88c997d4eb6f66f9b52e56668cbdf48f5c99e183 [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) {