mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-08-18 20:05:48 +00:00
+6
-3
@@ -435,9 +435,8 @@ static int hyper_setup_stdio_events(struct hyper_exec *exec, struct stdio_config
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stdout, "hyper_init_event container pts event %p, ops %p, fd %d\n",
|
||||
&exec->stdinev, &in_ops, exec->stdinev.fd);
|
||||
|
||||
fprintf(stdout, "hyper_init_event exec stdin event %p, ops %p, fd %d\n",
|
||||
&exec->stdinev, &in_ops, io->stdinevfd);
|
||||
exec->stdinev.fd = io->stdinevfd;
|
||||
if (hyper_init_event(&exec->stdinev, &in_ops, NULL) < 0 ||
|
||||
hyper_add_event(ctl.efd, &exec->stdinev, EPOLLOUT) < 0) {
|
||||
@@ -446,6 +445,8 @@ static int hyper_setup_stdio_events(struct hyper_exec *exec, struct stdio_config
|
||||
}
|
||||
exec->ref++;
|
||||
|
||||
fprintf(stdout, "hyper_init_event exec stdout event %p, ops %p, fd %d\n",
|
||||
&exec->stdoutev, &out_ops, io->stdoutevfd);
|
||||
exec->stdoutev.fd = io->stdoutevfd;
|
||||
if (hyper_init_event(&exec->stdoutev, &out_ops, NULL) < 0 ||
|
||||
hyper_add_event(ctl.efd, &exec->stdoutev, EPOLLIN) < 0) {
|
||||
@@ -454,6 +455,8 @@ static int hyper_setup_stdio_events(struct hyper_exec *exec, struct stdio_config
|
||||
}
|
||||
exec->ref++;
|
||||
|
||||
fprintf(stdout, "hyper_init_event exec stderr event %p, ops %p, fd %d\n",
|
||||
&exec->stderrev, &err_ops, io->stderrevfd);
|
||||
exec->stderrev.fd = io->stderrevfd;
|
||||
if (hyper_init_event(&exec->stderrev, &err_ops, NULL) < 0 ||
|
||||
hyper_add_event(ctl.efd, &exec->stderrev, EPOLLIN) < 0) {
|
||||
|
||||
+4
-3
@@ -905,7 +905,7 @@ static int hyper_ttyfd_handle(struct hyper_event *de, uint32_t len)
|
||||
|
||||
seq = hyper_get_be64(rbuf->data);
|
||||
|
||||
dprintf(stdout, "\n%s seq %" PRIu64", len %" PRIu32"\n", __func__, seq, len - 12);
|
||||
fprintf(stdout, "\n%s seq %" PRIu64", len %" PRIu32"\n", __func__, seq, len - 12);
|
||||
|
||||
exec = hyper_find_exec_by_seq(pod, seq);
|
||||
if (exec == NULL) {
|
||||
@@ -928,8 +928,8 @@ static int hyper_ttyfd_handle(struct hyper_event *de, uint32_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
dprintf(stdout, "find exec %s pid %d, seq is %" PRIu64 "\n",
|
||||
exec->id ? exec->id : "pod", exec->pid, exec->seq);
|
||||
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) {
|
||||
fprintf(stdout, "exec seq %" PRIu64 " exited, don't accept any input\n", exec->seq);
|
||||
@@ -940,6 +940,7 @@ static int hyper_ttyfd_handle(struct hyper_event *de, uint32_t len)
|
||||
/* size == 0 means we had received eof */
|
||||
if (size == 0 && !exec->tty) {
|
||||
exec->close_stdin_request = 1;
|
||||
fprintf(stdout, "get close stdin request\n");
|
||||
/* we can't hup the stdinev here, force hup on next write */
|
||||
if (hyper_modify_event(ctl.efd, &exec->stdinev, EPOLLOUT) < 0) {
|
||||
fprintf(stderr, "modify exec pts event to in & out failed\n");
|
||||
|
||||
Reference in New Issue
Block a user