release exec immediately if exec has no tty

Only signal handler operates the exex struct, we
can release exec immediately

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
Gao feng
2015-09-24 10:55:57 +08:00
parent 08764d5bbc
commit 600e8dd3c8
+3 -2
View File
@@ -433,13 +433,14 @@ int hyper_release_exec(struct hyper_exec *exec,
{
int i;
if (!exec->exit) {
if (!exec->exit && exec->seq) {
fprintf(stdout, "first user of exec exit\n");
exec->exit = 1;
return 0;
}
fprintf(stdout, "second user of exec exit, release\n");
/* exec has no pty or the pty user already exited */
fprintf(stdout, "last user of exec exit, release\n");
close(exec->e.fd);
close(exec->ptyfd);
hyper_reset_event(&exec->e);