summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/openvpn/misc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index 63b4c1c..19bbef7 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -376,8 +376,11 @@ openvpn_popen (const struct argv *a, const struct env_set *es)
}
else /* parent side */
{
- ret=pipe_stdout[0];
- close (pipe_stdout[1]);
+ int status = 0;
+
+ waitpid(pid, &status, 0);
+ ret = pipe_stdout[0];
+ close (pipe_stdout[1]);
}
}
else {