mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-08-24 08:07:21 +00:00
convert hyper_socketpair() to pipe2
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
+1
-1
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user