conf: always close pipe in run_userns_fn()

parent 3d7213d3
...@@ -4063,6 +4063,7 @@ struct userns_fn_data { ...@@ -4063,6 +4063,7 @@ struct userns_fn_data {
static int run_userns_fn(void *data) static int run_userns_fn(void *data)
{ {
int ret;
char c; char c;
struct userns_fn_data *d = data; struct userns_fn_data *d = data;
...@@ -4072,14 +4073,14 @@ static int run_userns_fn(void *data) ...@@ -4072,14 +4073,14 @@ static int run_userns_fn(void *data)
/* Wait for parent to finish establishing a new mapping in the user /* Wait for parent to finish establishing a new mapping in the user
* namespace we are executing in. * namespace we are executing in.
*/ */
if (lxc_read_nointr(d->p[0], &c, 1) != 1) ret = lxc_read_nointr(d->p[0], &c, 1);
return -1;
/* Close read end of the pipe. */ /* Close read end of the pipe. */
close(d->p[0]); close(d->p[0]);
if (ret != 1)
return -1;
if (d->fn_name) if (d->fn_name)
TRACE("calling function \"%s\"", d->fn_name); TRACE("Calling function \"%s\"", d->fn_name);
/* Call function to run. */ /* Call function to run. */
return d->fn(d->arg); return d->fn(d->arg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment