Skip to content

Commit

Permalink
Fixed the right angle brackets in subprocess code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyu committed Mar 31, 2015
1 parent 905e6cc commit 1d5cc16
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
40 changes: 20 additions & 20 deletions 3rdparty/libprocess/include/process/subprocess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class Subprocess
const Subprocess::IO& out,
const Subprocess::IO& err,
const Option<flags::FlagsBase>& flags,
const Option<std::map<std::string, std::string> >& environment,
const Option<lambda::function<int()> >& setup,
const Option<std::map<std::string, std::string>>& environment,
const Option<lambda::function<int()>>& setup,
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone);
pid_t(const lambda::function<int()>&)>>& clone);

enum Mode
{
Expand Down Expand Up @@ -100,7 +100,7 @@ class Subprocess

// Returns a future from process::reap of this subprocess.
// Discarding this future has no effect on the subprocess.
Future<Option<int> > status() const { return data->status; }
Future<Option<int>> status() const { return data->status; }

private:
friend Try<Subprocess> subprocess(
Expand All @@ -110,10 +110,10 @@ class Subprocess
const Subprocess::IO& out,
const Subprocess::IO& err,
const Option<flags::FlagsBase>& flags,
const Option<std::map<std::string, std::string> >& environment,
const Option<lambda::function<int()> >& setup,
const Option<std::map<std::string, std::string>>& environment,
const Option<lambda::function<int()>>& setup,
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone);
pid_t(const lambda::function<int()>&)>>& clone);

struct Data
{
Expand All @@ -134,7 +134,7 @@ class Subprocess
Option<int> out;
Option<int> err;

Future<Option<int> > status;
Future<Option<int>> status;
};

Subprocess() : data(new Data()) {}
Expand All @@ -159,20 +159,20 @@ Try<Subprocess> subprocess(
const Subprocess::IO& out,
const Subprocess::IO& err,
const Option<flags::FlagsBase>& flags = None(),
const Option<std::map<std::string, std::string> >& environment = None(),
const Option<lambda::function<int()> >& setup = None(),
const Option<std::map<std::string, std::string>>& environment = None(),
const Option<lambda::function<int()>>& setup = None(),
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone = None());
pid_t(const lambda::function<int()>&)>>& clone = None());


inline Try<Subprocess> subprocess(
const std::string& path,
std::vector<std::string> argv,
const Option<flags::FlagsBase>& flags = None(),
const Option<std::map<std::string, std::string> >& environment = None(),
const Option<lambda::function<int()> >& setup = None(),
const Option<std::map<std::string, std::string>>& environment = None(),
const Option<lambda::function<int()>>& setup = None(),
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone = None())
pid_t(const lambda::function<int()>&)>>& clone = None())
{
return subprocess(
path,
Expand All @@ -195,10 +195,10 @@ inline Try<Subprocess> subprocess(
const Subprocess::IO& in,
const Subprocess::IO& out,
const Subprocess::IO& err,
const Option<std::map<std::string, std::string> >& environment = None(),
const Option<lambda::function<int()> >& setup = None(),
const Option<std::map<std::string, std::string>>& environment = None(),
const Option<lambda::function<int()>>& setup = None(),
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone = None())
pid_t(const lambda::function<int()>&)>>& clone = None())
{
std::vector<std::string> argv(3);
argv[0] = "sh";
Expand All @@ -220,10 +220,10 @@ inline Try<Subprocess> subprocess(

inline Try<Subprocess> subprocess(
const std::string& command,
const Option<std::map<std::string, std::string> >& environment = None(),
const Option<lambda::function<int()> >& setup = None(),
const Option<std::map<std::string, std::string>>& environment = None(),
const Option<lambda::function<int()>>& setup = None(),
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& clone = None())
pid_t(const lambda::function<int()>&)>>& clone = None())
{
return subprocess(
command,
Expand Down
14 changes: 7 additions & 7 deletions 3rdparty/libprocess/src/subprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace internal {

// See the comment below as to why subprocess is passed to cleanup.
static void cleanup(
const Future<Option<int> >& result,
Promise<Option<int> >* promise,
const Future<Option<int>>& result,
Promise<Option<int>>* promise,
const Subprocess& subprocess)
{
CHECK(!result.isPending());
Expand Down Expand Up @@ -111,7 +111,7 @@ static int childMain(
const Subprocess::IO& out,
const Subprocess::IO& err,
os::ExecEnv* envp,
const Option<lambda::function<int()> >& setup,
const Option<lambda::function<int()>>& setup,
int stdinFd[2],
int stdoutFd[2],
int stderrFd[2])
Expand Down Expand Up @@ -173,10 +173,10 @@ Try<Subprocess> subprocess(
const Subprocess::IO& out,
const Subprocess::IO& err,
const Option<flags::FlagsBase>& flags,
const Option<map<string, string> >& environment,
const Option<lambda::function<int()> >& setup,
const Option<map<string, string>>& environment,
const Option<lambda::function<int()>>& setup,
const Option<lambda::function<
pid_t(const lambda::function<int()>&)> >& _clone)
pid_t(const lambda::function<int()>&)>>& _clone)
{
// File descriptors for redirecting stdin/stdout/stderr. These file
// descriptors are used for different purposes depending on the
Expand Down Expand Up @@ -385,7 +385,7 @@ Try<Subprocess> subprocess(
// the termination signal. Otherwise, the caller can discard the
// reap future, and we will not know when it is safe to close the
// file descriptors.
Promise<Option<int> >* promise = new Promise<Option<int> >();
Promise<Option<int>>* promise = new Promise<Option<int>>();
process.data->status = promise->future();

// We need to bind a copy of this Subprocess into the onAny callback
Expand Down

0 comments on commit 1d5cc16

Please sign in to comment.