io: some fixes to handling of /dev/null when running commands
commite155494cf0b876c45c3c68a9ab6c641aac22dfdf
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 11 Jan 2016 13:02:16 +0000 (11 13:02 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 20 Jan 2016 11:30:56 +0000 (20 11:30 +0000)
treede2151068a6d5db9350210d3d9a540537f84d96e
parent0c0a55b229bb6d61408394766bcbb04beecd5fa5
io: some fixes to handling of /dev/null when running commands

The /dev/null file handle was leaked in a couple of places.
There is also the possibility that both readfd and writefd
point to the same /dev/null file handle, so care must be
taken not to close the same file handle twice.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
io/channel-command.c