When running in client mode, the listen file descriptor
is not initialized, and so has value 0. At destroy time,
the listen FD is closed if its value is greater than or
equal to zero, which causes STDIN to be closed.
Bugzilla ID: 630
Fixes:
949735312f5e ("net/virtio: move vhost-user specifics to its backend")
Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
dev->backend_data = data;
data->vhostfd = -1;
+ data->listenfd = -1;
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0) {