From 014ed4d82766db510a7003910bd0a6becc95fe0d Mon Sep 17 00:00:00 2001 From: Renge Date: Fri, 15 Apr 2022 21:01:23 -0400 Subject: [PATCH] fix: fix some bugs --- hw4/src/jobs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw4/src/jobs.c b/hw4/src/jobs.c index 26e2a55..25be457 100644 --- a/hw4/src/jobs.c +++ b/hw4/src/jobs.c @@ -99,7 +99,6 @@ void io_handler(int sig) { job_data_array[i]->output = realloc(job_data_array[i]->output, (job_data_array[i]->output_length + 1) * sizeof(char)); job_data_array[i]->output[job_data_array[i]->output_length - 1] = c; job_data_array[i]->output[job_data_array[i]->output_length] = '\0'; - printf("%c", c); } } } @@ -369,7 +368,8 @@ int jobs_run(PIPELINE *pline) { exit(exit_code); } - // close(new->pipe[1]); + if (new->pipeline->capture_output) + close(new->pipe[1]); new->status = RUNNING; return 0;