Skip to content
Snippets Groups Projects
Commit cc0e2956 authored by Moe Jette's avatar Moe Jette
Browse files

comment why we require salloc to run in the foreground

parent 4831b79d
No related branches found
No related tags found
No related merge requests found
...@@ -165,7 +165,11 @@ int main(int argc, char *argv[]) ...@@ -165,7 +165,11 @@ int main(int argc, char *argv[])
is_interactive = isatty(STDIN_FILENO); is_interactive = isatty(STDIN_FILENO);
if (is_interactive) { if (is_interactive) {
bool sent_msg = false; bool sent_msg = false;
/* Wait as long as we are running in the background */ /*
* Job control: interactive sub-processes run in the foreground
* process group of the controlling terminal. In order to grant
* this (tcsetpgrp), salloc needs to be in the foreground first.
*/
while (tcgetpgrp(STDIN_FILENO) != (pid = getpgrp())) { while (tcgetpgrp(STDIN_FILENO) != (pid = getpgrp())) {
if (!sent_msg) { if (!sent_msg) {
error("Waiting for program to be placed in " error("Waiting for program to be placed in "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment