diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-09-11 10:09:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-09-11 10:09:45 +0000 |
commit | 36272db3cad448211389168cced4baac39a1a0d1 (patch) | |
tree | e570502f0d6730e432657fc86304fa02a2de80fa /lib/Support/Unix/Process.inc | |
parent | 8568f9cb5af587ccee4088af3e2d617b3c30d403 (diff) |
Diffstat (limited to 'lib/Support/Unix/Process.inc')
-rw-r--r-- | lib/Support/Unix/Process.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc index fa515d44f3f2..3185f45a3a61 100644 --- a/lib/Support/Unix/Process.inc +++ b/lib/Support/Unix/Process.inc @@ -211,7 +211,10 @@ std::error_code Process::FixupStandardFileDescriptors() { assert(errno == EBADF && "expected errno to have EBADF at this point!"); if (NullFD < 0) { - if ((NullFD = RetryAfterSignal(-1, ::open, "/dev/null", O_RDWR)) < 0) + // Call ::open in a lambda to avoid overload resolution in + // RetryAfterSignal when open is overloaded, such as in Bionic. + auto Open = [&]() { return ::open("/dev/null", O_RDWR); }; + if ((NullFD = RetryAfterSignal(-1, Open)) < 0) return std::error_code(errno, std::generic_category()); } |