diff options
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Program.inc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc index ee7df0a86b8..7d3537e2072 100644 --- a/llvm/lib/Support/Unix/Program.inc +++ b/llvm/lib/Support/Unix/Program.inc @@ -1,4 +1,4 @@ -//===- llvm/Support/Unix/Program.cpp ----------------------------*- C++ -*-===// +//===- llvm/Support/Unix/Program.cpp -----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -30,7 +30,9 @@ #if HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif -#include <csignal> +#if HAVE_SIGNAL_H +#include <signal.h> +#endif #if HAVE_FCNTL_H #include <fcntl.h> #endif @@ -94,9 +96,7 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name, return errc::no_such_file_or_directory; } -namespace { - -bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) { +static bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) { if (!Path) // Noop return false; std::string File; @@ -125,8 +125,8 @@ bool RedirectIO(const StringRef *Path, int FD, std::string* ErrMsg) { } #ifdef HAVE_POSIX_SPAWN -bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg, - posix_spawn_file_actions_t *FileActions) { +static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg, + posix_spawn_file_actions_t *FileActions) { if (!Path) // Noop return false; const char *File; @@ -144,10 +144,10 @@ bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg, } #endif -void TimeOutHandler(int Sig) { +static void TimeOutHandler(int Sig) { } -void SetMemoryLimits (unsigned size) +static void SetMemoryLimits (unsigned size) { #if HAVE_SYS_RESOURCE_H && HAVE_GETRLIMIT && HAVE_SETRLIMIT struct rlimit r; @@ -176,9 +176,7 @@ void SetMemoryLimits (unsigned size) #endif } -} // end anonymous namespace - -} // end namespace llvm +} static bool Execute(ProcessInfo &PI, StringRef Program, const char **args, const char **envp, const StringRef **redirects, @@ -421,12 +419,12 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait, return WaitResult; } -std::error_code sys::ChangeStdinToBinary() { + std::error_code sys::ChangeStdinToBinary(){ // Do nothing, as Unix doesn't differentiate between text and binary. return std::error_code(); } -std::error_code sys::ChangeStdoutToBinary() { + std::error_code sys::ChangeStdoutToBinary(){ // Do nothing, as Unix doesn't differentiate between text and binary. return std::error_code(); } @@ -468,5 +466,4 @@ bool llvm::sys::commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef<co } return true; } - -} // end namespace llvm +} |