From 66a0a987914626fc0ea86067a0ea1dd7a2bebdd2 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Sun, 30 May 2010 23:31:40 +0100 Subject: Make error codes returned by librabbitmq functions opaque Windows doesn't generally use POSIX error codes, which poses a problem for librabbitmq's approach of using those error codes in its API. So make the librabbitmq error codes opaque: They are still be integers, but client code is not supposed to assume anything about them, except that they can be passed to a new amqp_error_string() function which returns the corresponding error message Internally, the error codes are either taken from a set of librabbitmq-specific values, or correspond to an OS-specific (POSIX or win32) error code, with a simple encoding to indicate which is which. --- examples/amqp_listenq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/amqp_listenq.c') diff --git a/examples/amqp_listenq.c b/examples/amqp_listenq.c index 00dd2d7..1fc7db0 100644 --- a/examples/amqp_listenq.c +++ b/examples/amqp_listenq.c @@ -107,7 +107,7 @@ int main(int argc, char const * const *argv) { amqp_maybe_release_buffers(conn); result = amqp_simple_wait_frame(conn, &frame); printf("Result %d\n", result); - if (result <= 0) + if (result < 0) break; printf("Frame type %d, channel %d\n", frame.frame_type, frame.channel); @@ -125,7 +125,7 @@ int main(int argc, char const * const *argv) { (int) d->routing_key.len, (char *) d->routing_key.bytes); result = amqp_simple_wait_frame(conn, &frame); - if (result <= 0) + if (result < 0) break; if (frame.frame_type != AMQP_FRAME_HEADER) { @@ -144,7 +144,7 @@ int main(int argc, char const * const *argv) { while (body_received < body_target) { result = amqp_simple_wait_frame(conn, &frame); - if (result <= 0) + if (result < 0) break; if (frame.frame_type != AMQP_FRAME_BODY) { -- cgit v1.2.1