X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvconn-stream.c;h=df728d5ccde9870c792981f6d198f4b3b0872114;hb=f40a9b61e2b758e60a38fc706d7d1253ef59a23d;hp=3d0887463ac87d8854a3342e857d74970425a22c;hpb=1e3c004749e1e0498dac6240b6edda472718dde2;p=openvswitch diff --git a/lib/vconn-stream.c b/lib/vconn-stream.c index 3d088746..df728d5c 100644 --- a/lib/vconn-stream.c +++ b/lib/vconn-stream.c @@ -85,13 +85,16 @@ vconn_stream_open(const char *name, char *suffix OVS_UNUSED, error = stream_open_with_default_ports(name, OFP_TCP_PORT, OFP_SSL_PORT, &stream); - - if (error && error != EAGAIN) { - return error; + if (!error) { + error = stream_connect(stream); + if (!error || error == EAGAIN) { + *vconnp = vconn_stream_new(stream, error); + return 0; + } } - *vconnp = vconn_stream_new(stream, error); - return 0; + stream_close(stream); + return error; } static struct vconn_stream *