android: Don’t use OPEN_MAX

NDK r13 and earlier provided a bogus definition of OPEN_MAX, but it was
removed from NDK r14 effective in a future API level. It is also not
available when using a standalone toolchain with unified headers.

ff5f17bc8a

Bug: crashpad:30
Change-Id: Ic89d6879cb1a4e5b9d20e9cb06bedd5176df0f2a
Reviewed-on: https://chromium-review.googlesource.com/458121
Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Mark Mentovai 2017-03-23 11:56:15 -04:00
parent 810d4815df
commit cedfd7b9cd

View File

@ -179,7 +179,7 @@ void CloseMultipleNowOrOnExec(int fd, int preserve_fd) {
max_fd = std::max(max_fd, getdtablesize());
#endif
#if !defined(OS_LINUX) || defined(OPEN_MAX)
#if !(defined(OS_LINUX) || defined(OS_ANDROID)) || defined(OPEN_MAX)
// Linux does not provide OPEN_MAX. See
// https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/limits.h?id=77293034696e3e0b6c8b8fc1f96be091104b3d2b.
max_fd = std::max(max_fd, OPEN_MAX);