X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstream.c;h=43c95b6bc2836d608d6d4a4d901fb709e93c35ff;hb=abfec865566e6cce961cc8660de1ddfdc85dae5f;hp=667a23ff370facf6d8266aa976afc993bd992d6b;hpb=1e3c004749e1e0498dac6240b6edda472718dde2;p=openvswitch diff --git a/lib/stream.c b/lib/stream.c index 667a23ff..43c95b6b 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -35,10 +35,10 @@ #include "poll-loop.h" #include "random.h" #include "util.h" - -#define THIS_MODULE VLM_stream #include "vlog.h" +VLOG_DEFINE_THIS_MODULE(stream) + /* State of an active stream.*/ enum stream_state { SCS_CONNECTING, /* Underlying stream is not connected. */ @@ -240,14 +240,16 @@ stream_open_block(int error, struct stream **streamp) fatal_signal_run(); - while (error == EAGAIN) { - stream_run(stream); - stream_run_wait(stream); - stream_connect_wait(stream); - poll_block(); - error = stream_connect(stream); + if (!error) { + while ((error = stream_connect(stream)) == EAGAIN) { + stream_run(stream); + stream_run_wait(stream); + stream_connect_wait(stream); + poll_block(); + } assert(error != EINPROGRESS); } + if (error) { stream_close(stream); *streamp = NULL; @@ -767,7 +769,7 @@ stream_content_type_to_string(enum stream_content_type type) void stream_report_content(const void *data, size_t size, enum stream_content_type expected_type, - enum vlog_module module, const char *stream_name) + struct vlog_module *module, const char *stream_name) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5); enum stream_content_type actual_type;