gspawn, win32: fix redirecting only stderr

Problem was just a typo - wrong variable was checked before enabling
stderr redirection.
This fixes error-only redirection spawn-test added in previous commit.

Behavior while redirecting only stdout should be unaffected,
since old code tried to redirect stderr to -1 in such case,
which silently failed I think.
This commit is contained in:
Vasily Galkin 2018-12-26 23:51:54 +03:00
parent 50cb4f221c
commit cafb61a179

View File

@ -657,7 +657,7 @@ do_spawn_with_fds (gint *exit_status,
new_argv[ARG_STDOUT] = "-";
}
if (stdout_fd != -1)
if (stderr_fd != -1)
{
_g_sprintf (args[ARG_STDERR], "%d", stderr_fd);
new_argv[ARG_STDERR] = args[ARG_STDERR];