summaryrefslogtreecommitdiff
path: root/lib/stream.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-11-06 13:14:55 -0800
committerBen Pfaff <blp@nicira.com>2013-01-16 16:03:37 -0800
commitcb22974d773942d66da42b700b8bca0db27a0920 (patch)
tree6412724be1bfc46d7235c4e2105c279bbe20d320 /lib/stream.c
parent4749f73d12c844b318af7f45cf45e1acac9f7c08 (diff)
downloadopenvswitch-cb22974d773942d66da42b700b8bca0db27a0920.tar.gz
Replace most uses of assert by ovs_assert.
This is a straight search-and-replace, except that I also removed #include <assert.h> from each file where there were no assert calls left. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/stream.c')
-rw-r--r--lib/stream.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/stream.c b/lib/stream.c
index 2ee5731eb..0c6a8c13f 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -16,7 +16,6 @@
#include <config.h>
#include "stream-provider.h"
-#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <netinet/in.h>
@@ -74,14 +73,14 @@ check_stream_classes(void)
for (i = 0; i < ARRAY_SIZE(stream_classes); i++) {
const struct stream_class *class = stream_classes[i];
- assert(class->name != NULL);
- assert(class->open != NULL);
+ ovs_assert(class->name != NULL);
+ ovs_assert(class->open != NULL);
if (class->close || class->recv || class->send || class->run
|| class->run_wait || class->wait) {
- assert(class->close != NULL);
- assert(class->recv != NULL);
- assert(class->send != NULL);
- assert(class->wait != NULL);
+ ovs_assert(class->close != NULL);
+ ovs_assert(class->recv != NULL);
+ ovs_assert(class->send != NULL);
+ ovs_assert(class->wait != NULL);
} else {
/* This class delegates to another one. */
}
@@ -89,12 +88,12 @@ check_stream_classes(void)
for (i = 0; i < ARRAY_SIZE(pstream_classes); i++) {
const struct pstream_class *class = pstream_classes[i];
- assert(class->name != NULL);
- assert(class->listen != NULL);
+ ovs_assert(class->name != NULL);
+ ovs_assert(class->listen != NULL);
if (class->close || class->accept || class->wait) {
- assert(class->close != NULL);
- assert(class->accept != NULL);
- assert(class->wait != NULL);
+ ovs_assert(class->close != NULL);
+ ovs_assert(class->accept != NULL);
+ ovs_assert(class->wait != NULL);
} else {
/* This class delegates to another one. */
}
@@ -250,7 +249,7 @@ stream_open_block(int error, struct stream **streamp)
stream_connect_wait(stream);
poll_block();
}
- assert(error != EINPROGRESS);
+ ovs_assert(error != EINPROGRESS);
}
if (error) {
@@ -317,7 +316,7 @@ static void
scs_connecting(struct stream *stream)
{
int retval = (stream->class->connect)(stream);
- assert(retval != EINPROGRESS);
+ ovs_assert(retval != EINPROGRESS);
if (!retval) {
stream->state = SCS_CONNECTED;
} else if (retval != EAGAIN) {
@@ -419,8 +418,8 @@ stream_run_wait(struct stream *stream)
void
stream_wait(struct stream *stream, enum stream_wait_type wait)
{
- assert(wait == STREAM_CONNECT || wait == STREAM_RECV
- || wait == STREAM_SEND);
+ ovs_assert(wait == STREAM_CONNECT || wait == STREAM_RECV
+ || wait == STREAM_SEND);
switch (stream->state) {
case SCS_CONNECTING:
@@ -580,8 +579,8 @@ pstream_accept(struct pstream *pstream, struct stream **new_stream)
if (retval) {
*new_stream = NULL;
} else {
- assert((*new_stream)->state != SCS_CONNECTING
- || (*new_stream)->class->connect);
+ ovs_assert((*new_stream)->state != SCS_CONNECTING
+ || (*new_stream)->class->connect);
}
return retval;
}
@@ -651,7 +650,7 @@ stream_init(struct stream *stream, const struct stream_class *class,
: SCS_DISCONNECTED);
stream->error = connect_status;
stream->name = xstrdup(name);
- assert(stream->state != SCS_CONNECTING || class->connect);
+ ovs_assert(stream->state != SCS_CONNECTING || class->connect);
}
void