diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c index b210f3c1743a17329491bddfbeadff434ed2b196..a3a7d1c14074934eb218dfa94bf8722fc966498f 100644 --- a/src/slurmd/slurmstepd/io.c +++ b/src/slurmd/slurmstepd/io.c @@ -678,7 +678,7 @@ static void *_window_manager(void *arg) { struct window_info *win_info = (struct window_info *) arg; pty_winsz_t winsz; - size_t len; + ssize_t len; struct winsize ws; struct pollfd ufds; char buf[4]; diff --git a/src/slurmd/slurmstepd/mgr.c b/src/slurmd/slurmstepd/mgr.c index 5671b7cbdd3f08b8a9bd5ca08f0c7c7e3d731e34..8ccb67b991283fc09249ffeb4d3427866a6b4da9 100644 --- a/src/slurmd/slurmstepd/mgr.c +++ b/src/slurmd/slurmstepd/mgr.c @@ -954,24 +954,17 @@ _fork_all_tasks(slurmd_job_t *job) jobacct_g_set_proctrack_container_id(job->cont_id); for (i = 0; i < job->ntasks; i++) { - if (job->pty && (job->task[i]->gtid == 0)) - continue; /* - * Put this task in the step process group - */ - if (setpgid (job->task[i]->pid, job->pgid) < 0) { - if (job->pty) { - /* login_tty() must put task zero in its own - * session, causing setpgid() to fail, setsid() - * has already set its process group as desired */ - debug("Unable to put task %d (pid %ld) into " - "pgrp %ld: %m", - i, job->task[i]->pid, job->pgid); - } else { - error("Unable to put task %d (pid %ld) into " - "pgrp %ld: %m", - i, job->task[i]->pid, job->pgid); - } + * Put this task in the step process group + * login_tty() must put task zero in its own + * session, causing setpgid() to fail, setsid() + * has already set its process group as desired + */ + if (((job->pty == 0) || (job->task[i]->gtid != 0)) + && (setpgid (job->task[i]->pid, job->pgid) < 0)) { + error("Unable to put task %d (pid %ld) into " + "pgrp %ld: %m", + i, job->task[i]->pid, job->pgid); } if (slurm_container_add(job, job->task[i]->pid) == SLURM_ERROR) {