Merge pull request #217 from gao-feng/close_stdin_by_container

don't accept any input if stdin is closed by process
This commit is contained in:
Xu Wang
2016-10-15 14:08:03 +08:00
committed by GitHub
+3 -2
View File
@@ -930,8 +930,9 @@ static int hyper_ttyfd_handle(struct hyper_event *de, uint32_t len)
fprintf(stdout, "find exec %s pid %d, seq is %" PRIu64 "\n",
exec->container_id ? exec->container_id : "pod", exec->pid, exec->seq);
// if exec is exited, the event fd of exec is invalid. don't accept any input.
if (exec->exit || exec->close_stdin_request) {
// if exec is exited or stdin is closed by process, the event fd of exec is invalid.
// don't accept any input.
if (exec->exit || exec->close_stdin_request || exec->stdinev.fd < 0) {
fprintf(stdout, "exec seq %" PRIu64 " exited, don't accept any input\n", exec->seq);
return 0;
}