Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 1c8902a

Browse files
authored
Merge pull request #307 from bergwolf/cleanup-pty
umount pty when cleaning up containers
2 parents 7048d75 + 1dcc327 commit 1c8902a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/container.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,15 @@ static int hyper_setup_pty(struct hyper_container *c)
708708
return 0;
709709
}
710710

711+
static void hyper_cleanup_pty(struct hyper_container *c)
712+
{
713+
char path[512];
714+
715+
sprintf(path, "/tmp/hyper/%s/devpts/", c->id);
716+
if (umount(path) < 0)
717+
perror("clean up container pty failed");
718+
}
719+
711720
int hyper_setup_container(struct hyper_container *container, struct hyper_pod *pod)
712721
{
713722
int stacksize = getpagesize() * 42;
@@ -838,6 +847,7 @@ void hyper_cleanup_container(struct hyper_container *c, struct hyper_pod *pod)
838847
{
839848
hyper_cleanup_container_mounts(c, pod);
840849
close(c->ns);
850+
hyper_cleanup_pty(c);
841851
hyper_cleanup_container_portmapping(c, pod);
842852
hyper_free_container(c);
843853
}

0 commit comments

Comments
 (0)