Commit a5662d50 authored by Raymond Toy's avatar Raymond Toy

Rename stdin/stdout/stderr to proc_*

Because we include stdio.h now, Solaris defines stdin, stdout, and
stderr in a way that they can't be used to name the args to the spawn
function.  Hence rename these args.
parent fffafb5a
Pipeline #185 passed with stage
in 8 minutes and 25 seconds
......@@ -16,7 +16,7 @@
pid_t
spawn(char *program, char *argv[], char *envp[], char *pty_name,
int stdin, int stdout, int stderr)
int proc_stdin, int proc_stdout, int proc_stderr)
{
pid_t pid;
sigset_t set;
......@@ -51,12 +51,12 @@ spawn(char *program, char *argv[], char *envp[], char *pty_name,
}
/* Set up stdin, stdout, and stderr. */
if (stdin >= 0)
dup2(stdin, 0);
if (stdout >= 0)
dup2(stdout, 1);
if (stderr >= 0)
dup2(stderr, 2);
if (proc_stdin >= 0)
dup2(proc_stdin, 0);
if (proc_stdout >= 0)
dup2(proc_stdout, 1);
if (proc_stderr >= 0)
dup2(proc_stderr, 2);
/* Close all other fds. */
for (fd = sysconf(_SC_OPEN_MAX) - 1; fd >= 3; fd--)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment