#include "Unix.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Config/config.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/MutexGuard.h"
return std::string(Val);
}
-std::error_code
-Process::GetArgumentVector(SmallVectorImpl<const char *> &ArgsOut,
- ArrayRef<const char *> ArgsIn,
- SpecificBumpPtrAllocator<char> &) {
- ArgsOut.append(ArgsIn.begin(), ArgsIn.end());
-
- return std::error_code();
-}
-
namespace {
class FDCloser {
public:
for (int StandardFD : StandardFDs) {
struct stat st;
errno = 0;
- if (RetryAfterSignal(-1, fstat, StandardFD, &st) < 0) {
+ while (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)
+ if (errno == EBADF)
+ break;
+ // retry fstat if we got EINTR, otherwise bubble up the failure.
+ if (errno != EINTR)
return std::error_code(errno, std::generic_category());
}
// if fstat succeeds, move on to the next FD.
assert(errno == EBADF && "expected errno to have EBADF at this point!");
if (NullFD < 0) {
- if ((NullFD = RetryAfterSignal(-1, open, "/dev/null", O_RDWR)) < 0)
+ while ((NullFD = open("/dev/null", O_RDWR)) < 0) {
+ if (errno == EINTR)
+ continue;
return std::error_code(errno, std::generic_category());
+ }
}
if (NullFD == StandardFD)