mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76229 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -97,12 +97,12 @@ namespace sys {
|
|||||||
/// called then a std::string is thrown.
|
/// called then a std::string is thrown.
|
||||||
/// @returns an integer result code indicating the status of the program.
|
/// @returns an integer result code indicating the status of the program.
|
||||||
/// A zero or positive value indicates the result code of the program. A
|
/// A zero or positive value indicates the result code of the program. A
|
||||||
/// negative value is the signal number on which it terminated.
|
/// negative value is the signal number on which it terminated.
|
||||||
/// @see FindProgrambyName
|
/// @see FindProgrambyName
|
||||||
/// @brief Executes the program with the given set of \p args.
|
/// @brief Executes the program with the given set of \p args.
|
||||||
static void ExecuteNoWait(
|
static void ExecuteNoWait(
|
||||||
const Path& path, ///< sys::Path object providing the path of the
|
const Path& path, ///< sys::Path object providing the path of the
|
||||||
///< program to be executed. It is presumed this is the result of
|
///< program to be executed. It is presumed this is the result of
|
||||||
///< the FindProgramByName method.
|
///< the FindProgramByName method.
|
||||||
const char** args, ///< A vector of strings that are passed to the
|
const char** args, ///< A vector of strings that are passed to the
|
||||||
///< program. The first element should be the name of the program.
|
///< program. The first element should be the name of the program.
|
||||||
@ -120,7 +120,7 @@ namespace sys {
|
|||||||
///< higher limit, the child is killed and this call returns. If zero -
|
///< higher limit, the child is killed and this call returns. If zero -
|
||||||
///< no memory limit.
|
///< no memory limit.
|
||||||
std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
|
std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
|
||||||
///< instance in which error messages will be returned. If the string
|
///< instance in which error messages will be returned. If the string
|
||||||
///< is non-empty upon return an error occurred while invoking the
|
///< is non-empty upon return an error occurred while invoking the
|
||||||
///< program.
|
///< program.
|
||||||
);
|
);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//===- llvm/System/Unix/Program.cpp -----------------------------*- C++ -*-===//
|
//===- llvm/System/Unix/Program.cpp -----------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
// This file is distributed under the University of Illinois Open Source
|
// This file is distributed under the University of Illinois Open Source
|
||||||
// License. See LICENSE.TXT for details.
|
// License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements the Unix specific portion of the Program class.
|
// This file implements the Unix specific portion of the Program class.
|
||||||
@ -51,10 +51,10 @@ Program::FindProgramByName(const std::string& progName) {
|
|||||||
return temp;
|
return temp;
|
||||||
|
|
||||||
// At this point, the file name is valid and its not executable
|
// At this point, the file name is valid and its not executable
|
||||||
|
|
||||||
// Get the path. If its empty, we can't do anything to find it.
|
// Get the path. If its empty, we can't do anything to find it.
|
||||||
const char *PathStr = getenv("PATH");
|
const char *PathStr = getenv("PATH");
|
||||||
if (PathStr == 0)
|
if (PathStr == 0)
|
||||||
return Path();
|
return Path();
|
||||||
|
|
||||||
// Now we have a colon separated list of directories to search; try them.
|
// Now we have a colon separated list of directories to search; try them.
|
||||||
@ -142,14 +142,14 @@ static void SetMemoryLimits (unsigned size)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Program::ExecuteAndWait(const Path& path,
|
Program::ExecuteAndWait(const Path& path,
|
||||||
const char** args,
|
const char** args,
|
||||||
const char** envp,
|
const char** envp,
|
||||||
const Path** redirects,
|
const Path** redirects,
|
||||||
unsigned secondsToWait,
|
unsigned secondsToWait,
|
||||||
unsigned memoryLimit,
|
unsigned memoryLimit,
|
||||||
std::string* ErrMsg)
|
std::string* ErrMsg)
|
||||||
{
|
{
|
||||||
if (!path.canExecute()) {
|
if (!path.canExecute()) {
|
||||||
if (ErrMsg)
|
if (ErrMsg)
|
||||||
@ -174,7 +174,7 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
if (RedirectIO(redirects[0], 0, ErrMsg)) { return -1; }
|
if (RedirectIO(redirects[0], 0, ErrMsg)) { return -1; }
|
||||||
// Redirect stdout
|
// Redirect stdout
|
||||||
if (RedirectIO(redirects[1], 1, ErrMsg)) { return -1; }
|
if (RedirectIO(redirects[1], 1, ErrMsg)) { return -1; }
|
||||||
if (redirects[1] && redirects[2] &&
|
if (redirects[1] && redirects[2] &&
|
||||||
*(redirects[1]) == *(redirects[2])) {
|
*(redirects[1]) == *(redirects[2])) {
|
||||||
// If stdout and stderr should go to the same place, redirect stderr
|
// If stdout and stderr should go to the same place, redirect stderr
|
||||||
// to the FD already open for stdout.
|
// to the FD already open for stdout.
|
||||||
@ -192,7 +192,7 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
if (memoryLimit!=0) {
|
if (memoryLimit!=0) {
|
||||||
SetMemoryLimits(memoryLimit);
|
SetMemoryLimits(memoryLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute!
|
// Execute!
|
||||||
if (envp != 0)
|
if (envp != 0)
|
||||||
execve (path.c_str(), (char**)args, (char**)envp);
|
execve (path.c_str(), (char**)args, (char**)envp);
|
||||||
@ -233,7 +233,7 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
if (secondsToWait && errno == EINTR) {
|
if (secondsToWait && errno == EINTR) {
|
||||||
// Kill the child.
|
// Kill the child.
|
||||||
kill(child, SIGKILL);
|
kill(child, SIGKILL);
|
||||||
|
|
||||||
// Turn off the alarm and restore the signal handler
|
// Turn off the alarm and restore the signal handler
|
||||||
alarm(0);
|
alarm(0);
|
||||||
sigaction(SIGALRM, &Old, 0);
|
sigaction(SIGALRM, &Old, 0);
|
||||||
@ -271,16 +271,16 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
#else
|
#else
|
||||||
return -99;
|
return -99;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Program::ExecuteNoWait(const Path& path,
|
Program::ExecuteNoWait(const Path& path,
|
||||||
const char** args,
|
const char** args,
|
||||||
const char** envp,
|
const char** envp,
|
||||||
const Path** redirects,
|
const Path** redirects,
|
||||||
unsigned memoryLimit,
|
unsigned memoryLimit,
|
||||||
std::string* ErrMsg)
|
std::string* ErrMsg)
|
||||||
{
|
{
|
||||||
if (!path.canExecute()) {
|
if (!path.canExecute()) {
|
||||||
if (ErrMsg)
|
if (ErrMsg)
|
||||||
@ -304,7 +304,7 @@ Program::ExecuteNoWait(const Path& path,
|
|||||||
if (RedirectIO(redirects[0], 0, ErrMsg)) { return; }
|
if (RedirectIO(redirects[0], 0, ErrMsg)) { return; }
|
||||||
// Redirect stdout
|
// Redirect stdout
|
||||||
if (RedirectIO(redirects[1], 1, ErrMsg)) { return; }
|
if (RedirectIO(redirects[1], 1, ErrMsg)) { return; }
|
||||||
if (redirects[1] && redirects[2] &&
|
if (redirects[1] && redirects[2] &&
|
||||||
*(redirects[1]) == *(redirects[2])) {
|
*(redirects[1]) == *(redirects[2])) {
|
||||||
// If stdout and stderr should go to the same place, redirect stderr
|
// If stdout and stderr should go to the same place, redirect stderr
|
||||||
// to the FD already open for stdout.
|
// to the FD already open for stdout.
|
||||||
@ -322,7 +322,7 @@ Program::ExecuteNoWait(const Path& path,
|
|||||||
if (memoryLimit!=0) {
|
if (memoryLimit!=0) {
|
||||||
SetMemoryLimits(memoryLimit);
|
SetMemoryLimits(memoryLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute!
|
// Execute!
|
||||||
if (envp != 0)
|
if (envp != 0)
|
||||||
execve (path.c_str(), (char**)args, (char**)envp);
|
execve (path.c_str(), (char**)args, (char**)envp);
|
||||||
|
Reference in New Issue
Block a user