Permalink
Browse files

Merge branch 'upstream'

  • Loading branch information...
2 parents b966f59 + 0231562 commit f353933a5e7832d2444f895f76469d76fa6bfda1 @methodmissing committed Apr 25, 2012
Showing with 6 additions and 7 deletions.
  1. +1 −1 src/zmsg.c
  2. +5 −6 src/zsocket.c
View
@@ -138,7 +138,7 @@ zmsg_send (zmsg_t **self_p, void *socket)
int rc;
rc = zframe_send (&frame, socket,
zlist_size (self->frames)? ZFRAME_MORE: 0);
- assert (rc == 0);
+ assert (rc == 0 || (errno == ETERM || errno == EINTR));
frame = (zframe_t *) zlist_pop (self->frames);
}
zmsg_destroy (self_p);
View
@@ -69,8 +69,7 @@ zsocket_destroy (zctx_t *ctx, void *socket)
// --------------------------------------------------------------------------
// Bind a socket to a formatted endpoint. If the port is specified as
// '*', binds to any free port from ZSOCKET_DYNFROM to ZSOCKET_DYNTO
-// and returns the actual port number used. Otherwise asserts that the
-// bind succeeded with the specified port number. Always returns the
+// and returns the actual port number used. Always returns the
// port number if successful.
int
@@ -99,12 +98,12 @@ zsocket_bind (void *socket, const char *format, ...)
}
else {
rc = zmq_bind (socket, endpoint);
- if (rc)
- fprintf (stderr, "E: zsocket_bind to %s failed\n", endpoint);
- assert (rc == 0);
// Return actual port used for binding
- rc = atoi (strrchr (endpoint, ':') + 1);
+ if (rc == 0)
+ rc = atoi (strrchr (endpoint, ':') + 1);
+ else
+ rc = -1;
}
return rc;
}

0 comments on commit f353933

Please sign in to comment.