convert hyper_socketpair() to pipe2

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-03-26 18:23:03 +08:00
parent 411cffdeec
commit c455e8bc75
2 changed files with 1 additions and 16 deletions
+1 -1
View File
@@ -424,7 +424,7 @@ static int hyper_setup_container(struct hyper_pod *pod)
void *stack;
int ret = -1;
if (hyper_socketpair(PF_UNIX, SOCK_STREAM, 0, arg.ctl_pipe) < 0) {
if (pipe2(arg.ctl_pipe, O_CLOEXEC) < 0) {
perror("create pipe between hyper init and pod init failed");
goto out;
}
-15
View File
@@ -430,21 +430,6 @@ int hyper_setfd_nonblock(int fd)
return flags;
}
int hyper_socketpair(int domain, int type, int protocol, int sv[2])
{
if (socketpair(domain, type, protocol, sv) < 0) {
perror("socketpair failed");
return -1;
}
if (hyper_setfd_cloexec(sv[0]) < 0 ||
hyper_setfd_cloexec(sv[1]) < 0) {
return -1;
}
return 0;
}
static void hyper_unmount_all(void)
{
FILE *mtab;