mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-10-03 23:48:25 +00:00
close ptymaster when failed
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
@@ -386,11 +386,13 @@ static int hyper_setup_exec_tty(struct hyper_exec *e)
|
||||
|
||||
if (ioctl(ptymaster, TIOCSPTLCK, &unlock) < 0) {
|
||||
perror("ioctl unlock ptmx device failed");
|
||||
close(ptymaster);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl(ptymaster, TIOCGPTN, &e->ptyno) < 0) {
|
||||
perror("ioctl get execcmd pty device failed");
|
||||
close(ptymaster);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user