diff options
author | Kevin Wolf | 2009-12-02 12:24:42 +0100 |
---|---|---|
committer | Anthony Liguori | 2009-12-03 18:45:50 +0100 |
commit | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 (patch) | |
tree | 98d560a0de229f27a66f637cfcadbb1672e68cc3 /configure | |
parent | qemu-img: There is more than one host device driver (diff) | |
download | qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.tar.gz qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.tar.xz qemu-40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4.zip |
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1570,6 +1570,23 @@ if compile_prog "" "" ; then pipe2=yes fi +# check if accept4 is there +accept4=no +cat > $TMPC << EOF +#define _GNU_SOURCE +#include <sys/socket.h> +#include <stddef.h> + +int main(void) +{ + accept4(0, NULL, NULL, SOCK_CLOEXEC); + return 0; +} +EOF +if compile_prog "" "" ; then + accept4=yes +fi + # check if tee/splice is there. vmsplice was added same time. splice=no cat > $TMPC << EOF @@ -2014,6 +2031,9 @@ fi if test "$pipe2" = "yes" ; then echo "CONFIG_PIPE2=y" >> $config_host_mak fi +if test "$accept4" = "yes" ; then + echo "CONFIG_ACCEPT4=y" >> $config_host_mak +fi if test "$splice" = "yes" ; then echo "CONFIG_SPLICE=y" >> $config_host_mak fi |