conf: always close pipe in run_userns_fn()

parent 3d7213d3
......@@ -4063,6 +4063,7 @@ struct userns_fn_data {
static int run_userns_fn(void *data)
{
int ret;
char c;
struct userns_fn_data *d = data;
......@@ -4072,14 +4073,14 @@ static int run_userns_fn(void *data)
/* Wait for parent to finish establishing a new mapping in the user
* namespace we are executing in.
*/
if (lxc_read_nointr(d->p[0], &c, 1) != 1)
return -1;
ret = lxc_read_nointr(d->p[0], &c, 1);
/* Close read end of the pipe. */
close(d->p[0]);
if (ret != 1)
return -1;
if (d->fn_name)
TRACE("calling function \"%s\"", d->fn_name);
TRACE("Calling function \"%s\"", d->fn_name);
/* Call function to run. */
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