summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-11-13 20:19:55 +1100
committerMaxime Coste <mawww@kakoune.org>2023-11-13 20:19:55 +1100
commitc7d887d9d1567ea06d07affc01419143bafbf922 (patch)
tree55af969273dde0fab0b30f9369f3aaa09d8d27c5
parentfc7be678ed0ec71880a58a55de285c88bbd64bec (diff)
Rename stdin/stdout/stderr in Shell a they conflicts with macros
Fixes #5023
-rw-r--r--src/shell_manager.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shell_manager.cc b/src/shell_manager.cc
index 0e6203ec..334960b8 100644
--- a/src/shell_manager.cc
+++ b/src/shell_manager.cc
@@ -100,9 +100,9 @@ struct UniqueFd
struct Shell
{
pid_t pid;
- UniqueFd stdin;
- UniqueFd stdout;
- UniqueFd stderr;
+ UniqueFd in;
+ UniqueFd out;
+ UniqueFd err;
};
Shell spawn_shell(const char* shell, StringView cmdline,
@@ -309,9 +309,9 @@ std::pair<String, int> ShellManager::eval(
auto wait_time = Clock::now();
String stdout_contents, stderr_contents;
- auto stdout_reader = make_reader(shell.stdout.fd, stdout_contents, [&](bool){ shell.stdout.close(); });
- auto stderr_reader = make_reader(shell.stderr.fd, stderr_contents, [&](bool){ shell.stderr.close(); });
- auto stdin_writer = make_pipe_writer(shell.stdin, input);
+ auto stdout_reader = make_reader(shell.out.fd, stdout_contents, [&](bool){ shell.out.close(); });
+ auto stderr_reader = make_reader(shell.err.fd, stderr_contents, [&](bool){ shell.err.close(); });
+ auto stdin_writer = make_pipe_writer(shell.in, input);
// block SIGCHLD to make sure we wont receive it before
// our call to pselect, that will end up blocking indefinitly.
@@ -347,8 +347,8 @@ std::pair<String, int> ShellManager::eval(
}, EventMode::Urgent};
bool cancelling = false;
- while (not terminated or shell.stdin or
- ((flags & Flags::WaitForStdout) and (shell.stdout or shell.stderr)))
+ while (not terminated or shell.in or
+ ((flags & Flags::WaitForStdout) and (shell.out or shell.err)))
{
try
{