summaryrefslogtreecommitdiffstats
path: root/python/t/800-explicit-close.py
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-26 14:39:16 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-28 09:39:14 +0100
commit29d5a906ce5ec7e3a25b65e9e90d3598d6c8bd2c (patch)
tree20b00799136f95d71f8d6a0ae3e8b705ce32ada8 /python/t/800-explicit-close.py
parentd2cbbcc782a1164a2dd3b1d8601a1798ae4077a9 (diff)
downloadlibguestfs-29d5a906ce5ec7e3a25b65e9e90d3598d6c8bd2c.tar.gz
libguestfs-29d5a906ce5ec7e3a25b65e9e90d3598d6c8bd2c.tar.xz
libguestfs-29d5a906ce5ec7e3a25b65e9e90d3598d6c8bd2c.zip
launch: Avoid double-close when qemu exits early.
The stdin and stdout of the qemu process are aliased to g->fd: g->fd[0] = wfd[1]; g->fd[1] = rfd[0]; However if the child exits early, then child_cleanup closes g->fd[0], g->fd[1], AND the code at the cleanup1 label closes wfd[1], rfd[0], resulting in a double-close. Avoid this case by setting wfd[1], rfd[0] to -1. In the cleanup1 label, only close wfd[1], rfd[0] if they are not -1, and add the same for g->fd[0], g->fd[1]. (cherry picked from commit c87956837e962072fff61edef5b18e55ad42d730)
Diffstat (limited to 'python/t/800-explicit-close.py')
0 files changed, 0 insertions, 0 deletions