[PATCH] slurmstped: fix dup2() error with --pty
In commit commit b33cd7c8 Author: Mark A. Grondona <mgrondona@llnl.gov> Date: Fri Oct 7 13:52:43 2011 -0700 a minor bug was introduced because the io_dup_stdio() call was moved out from under the 'else' case of the empty if if (job->pty && (task->gtid == 0)) in task.c:exec_task() This results in the error dup2(stdin): Bad file descriptor For task 0 when --pty is used, because io_dup_stdio() is inappropriately being called after login_tty(). This patch collects the stdio setup into prepare_tty(), renames that function prepare_stdio(), and removes the io_dup_stdio() call from exec_task(). This removes the last io_* call from slurmstepd/task.c, so the io.h header is removed. I didn't see a problem with moving the io_dup_stdio() call earlier in the task setup path, but it could probably use another set of eyes. ---------- Note: This problem was at least partly fixed with https://github.com/SchedMD/slurm/commit/4d17300c5de7a8f146072bae8baaf773ca1fe98a
Loading
Please register or sign in to comment