From b2c73c4cc0b1b5077029ac6f44e56ed2d9c0b47e Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 11 Jun 2018 13:30:47 +0000 Subject: [PATCH] Fix build errors on some configurations It's been reported that template argument deduction for RetryAfterSignal fails if open is not prefixed with "::". This should help us build correctly on those platforms and explicitly specifying the namespace is more correct anyway. llvm-svn: 334403 --- llvm/lib/Support/MemoryBuffer.cpp | 2 +- llvm/lib/Support/Unix/Path.inc | 2 +- llvm/lib/Support/Unix/Process.inc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index d8cc853f2a87..4428c2f24e32 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -216,7 +216,7 @@ getMemoryBufferForStream(int FD, const Twine &BufferName) { // Read into Buffer until we hit EOF. do { Buffer.reserve(Buffer.size() + ChunkSize); - ReadBytes = sys::RetryAfterSignal(-1, read, FD, Buffer.end(), ChunkSize); + ReadBytes = sys::RetryAfterSignal(-1, ::read, FD, Buffer.end(), ChunkSize); if (ReadBytes == -1) return std::error_code(errno, std::generic_category()); Buffer.set_size(Buffer.size() + ReadBytes); diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 9800f8663094..b4001fb74817 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -767,7 +767,7 @@ std::error_code openFile(const Twine &Name, int &ResultFD, SmallString<128> Storage; StringRef P = Name.toNullTerminatedStringRef(Storage); - if ((ResultFD = sys::RetryAfterSignal(-1, open, P.begin(), OpenFlags, Mode)) < + if ((ResultFD = sys::RetryAfterSignal(-1, ::open, P.begin(), OpenFlags, Mode)) < 0) return std::error_code(errno, std::generic_category()); #ifndef O_CLOEXEC diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc index 43ba6d615c64..fa515d44f3f2 100644 --- a/llvm/lib/Support/Unix/Process.inc +++ b/llvm/lib/Support/Unix/Process.inc @@ -199,7 +199,7 @@ std::error_code Process::FixupStandardFileDescriptors() { for (int StandardFD : StandardFDs) { struct stat st; errno = 0; - if (RetryAfterSignal(-1, fstat, StandardFD, &st) < 0) { + if (RetryAfterSignal(-1, ::fstat, StandardFD, &st) < 0) { assert(errno && "expected errno to be set if fstat failed!"); // fstat should return EBADF if the file descriptor is closed. if (errno != EBADF) @@ -211,7 +211,7 @@ 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) + if ((NullFD = RetryAfterSignal(-1, ::open, "/dev/null", O_RDWR)) < 0) return std::error_code(errno, std::generic_category()); }