fix: android arm64/x86_64 compile error with getdtablesize

https://code.google.com/p/android/issues/detail?id=74387
https://codereview.chromium.org/349323003
This commit is contained in:
Csaba Keszegh 2015-03-06 13:28:42 +01:00
parent d247e1cf05
commit d2b452ebef

View File

@ -200,7 +200,7 @@ ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command,
if (outPipe) outPipe->close(Pipe::CLOSE_BOTH);
if (errPipe) errPipe->close(Pipe::CLOSE_BOTH);
// close all open file descriptors other than stdin, stdout, stderr
for (int i = 3; i < getdtablesize(); ++i)
for (int i = 3; i < sysconf(_SC_OPEN_MAX); ++i)
{
close(i);
}