1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-01 04:19:55 +00:00

Invert read/write bits on pipe in os/execute.

It was backwards, breaking this functionality.
This commit is contained in:
Calvin Rose 2020-12-09 19:04:05 -06:00
parent 6eaf8272e1
commit d53007739e

View File

@ -808,9 +808,9 @@ static Janet os_execute_impl(int32_t argc, Janet *argv, int is_async) {
#else #else
proc->pid = pid; proc->pid = pid;
#endif #endif
proc->in = get_stdio_for_handle(new_in, orig_in, 0); proc->in = get_stdio_for_handle(new_in, orig_in, 1);
proc->out = get_stdio_for_handle(new_out, orig_out, 1); proc->out = get_stdio_for_handle(new_out, orig_out, 0);
proc->err = get_stdio_for_handle(new_err, orig_err, 1); proc->err = get_stdio_for_handle(new_err, orig_err, 0);
proc->flags = 0; proc->flags = 0;
if (proc->in == NULL || proc->out == NULL || proc->err == NULL) { if (proc->in == NULL || proc->out == NULL || proc->err == NULL) {
janet_panic("failed to construct proc"); janet_panic("failed to construct proc");