diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 98e260cfde..5912a76ba6 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2299,7 +2299,7 @@ static char **do_lxcapi_get_interfaces(struct lxc_container *c) char **interfaces = NULL; char interface[IFNAMSIZ]; - if (pipe(pipefd) < 0) + if (pipe2(pipefd, O_CLOEXEC) < 0) return NULL; pid = fork(); @@ -2394,7 +2394,7 @@ static char **do_lxcapi_get_ips(struct lxc_container *c, const char *interface, int count = 0; char **addresses = NULL; - ret = pipe(pipefd); + ret = pipe2(pipefd, O_CLOEXEC); if (ret < 0) { SYSERROR("Failed to create pipe"); return NULL;