summaryrefslogtreecommitdiff
path: root/libs/pbd/system_exec.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-03-05 19:06:15 +0100
committerRobin Gareus <robin@gareus.org>2019-03-05 22:49:15 +0100
commite1ffe7857ffdd6d29a8548267571e76e569c1fe9 (patch)
tree564eabf08966b48da4c9c1e7f36c89f23edcd2ea /libs/pbd/system_exec.cc
parentfdf74cf850885a1145305b5a308b08945ba69dd6 (diff)
Use enum for exec stderr parameter (1/2)
Diffstat (limited to 'libs/pbd/system_exec.cc')
-rw-r--r--libs/pbd/system_exec.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc
index b7a7f87123..23f808a0c3 100644
--- a/libs/pbd/system_exec.cc
+++ b/libs/pbd/system_exec.cc
@@ -529,7 +529,7 @@ SystemExec::is_running ()
}
int
-SystemExec::start (int stderr_mode, const char * /*vfork_exec_wrapper*/)
+SystemExec::start (StdErrMode stderr_mode, const char * /*vfork_exec_wrapper*/)
{
char* working_dir = 0;
@@ -541,10 +541,10 @@ SystemExec::start (int stderr_mode, const char * /*vfork_exec_wrapper*/)
create_pipe(stdinP, true);
create_pipe(stdoutP, false);
- if (stderr_mode == 2) {
+ if (stderr_mode == MergeWithStdin) {
/* merge stout & stderr */
DuplicateHandle(GetCurrentProcess(), stdoutP[1], GetCurrentProcess(), &stderrP[1], 0, TRUE, DUPLICATE_SAME_ACCESS);
- } else if (stderr_mode == 1) {
+ } else if (stderr_mode == IgnoreAndClose) {
//TODO read/flush this pipe or close it...
create_pipe(stderrP, false);
} else {
@@ -807,7 +807,7 @@ SystemExec::is_running ()
}
int
-SystemExec::start (int stderr_mode, const char *vfork_exec_wrapper)
+SystemExec::start (StdErrMode stderr_mode, const char *vfork_exec_wrapper)
{
if (is_running ()) {
return 0;
@@ -889,12 +889,12 @@ SystemExec::start (int stderr_mode, const char *vfork_exec_wrapper)
::dup2 (pout[1], STDOUT_FILENO);
}
- if (stderr_mode == 2) {
+ if (stderr_mode == MergeWithStdin) {
/* merge STDERR into output */
if (pout[1] != STDERR_FILENO) {
::dup2(pout[1], STDERR_FILENO);
}
- } else if (stderr_mode == 1) {
+ } else if (stderr_mode == IgnoreAndClose) {
/* ignore STDERR */
::close(STDERR_FILENO);
} else {