Skip to content

Commit

Permalink
Revert "Fixed typo in vtx.c, and added preproc test for ENOTUNIQ (not…
Browse files Browse the repository at this point in the history
… available on BSD)"

This reverts commit 4280646.
  • Loading branch information
hintjens committed Jul 20, 2011
1 parent e54b59f commit e312afb
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.o
*.lst
core
client
server
Expand Down
2 changes: 1 addition & 1 deletion v3/build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
c -l -lzmq -lczmq vtx_test*.c
c -l vtx_test*.c

5 changes: 1 addition & 4 deletions v3/vtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "vtx.h"


// ---------------------------------------------------------------------
// Structure of our class
// Not threadsafe, do not access from multiple threads
Expand Down Expand Up @@ -116,11 +117,7 @@ vtx_register (vtx_t *self, char *scheme, zthread_attached_fn *driver_fn, Bool ve
driver = s_driver_new (self, scheme, driver_fn, verbose);
else {
rc = -1;
#ifdef ENOTUNIQ
errno = ENOTUNIQ;
// BSD and hence darwin doesn't support ENOTUNIQ, with no logical replacement
// Leaving this blank for now
#endif
}
return rc;
}
Expand Down
1 change: 0 additions & 1 deletion v3/vtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#define __VTX_INCLUDED__

#include "czmq.h"
#include <sys/errno.h>

// Types of routing per driver socket
#define VTX_ROUTING_NONE 0 // No output routing allowed
Expand Down
2 changes: 1 addition & 1 deletion v3/vtx_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ s_handle_io_error (char *reason)
|| errno == EPROTO
|| errno == ENOPROTOOPT
|| errno == EHOSTDOWN
|| errno == ENOENT
|| errno == ENONET
|| errno == EHOSTUNREACH
|| errno == EOPNOTSUPP
|| errno == ENETUNREACH
Expand Down
23 changes: 1 addition & 22 deletions v3/vtx_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,37 +476,19 @@ binding_require (vocket_t *vocket, char *address)
zclock_log ("E: bind failed: invalid address '%s'", address);
self->exception = TRUE;
}
<<<<<<< HEAD
if (!self->exception) {
if (bind (self->handle,
(const struct sockaddr *) &addr, IN_ADDR_SIZE) == -1) {
=======


// Case external address (1)
// Try binding to address with bind(2), and if that fails,
// set the exception flag (skipping case (2))
if (!self->exception) {
if (bind (self->handle, // http://beej.us/guide/bgnet/output/html/multipage/bindman.html
(const struct sockaddr *) &addr, IN_ADDR_SIZE) == -1) {
>>>>>>> 43a2dec... Fixed typo in vtx.c, and added preproc test for ENOTUNIQ (not available on BSD)
zclock_log ("E: bind failed: '%s'", strerror (errno));
self->exception = TRUE;
}
}
<<<<<<< HEAD
=======

// Case local address (2)
>>>>>>> 43a2dec... Fixed typo in vtx.c, and added preproc test for ENOTUNIQ (not available on BSD)
if (!self->exception) {
// Catch input on handle
zmq_pollitem_t item = { NULL, self->handle, ZMQ_POLLIN, 0 };
zloop_poller (self->driver->loop, &item, s_binding_input, vocket);
}
//* End transport-specific work

// If cannot bind after both attempts, free binding
if (self->exception) {
free (self->address);
free (self);
Expand Down Expand Up @@ -640,10 +622,7 @@ peering_send_msg (peering_t *self, zmsg_t *msg, int flags)
assert (self);
byte *data;
size_t size = zmsg_encode (msg, &data);
// note and NOM refers to a payload
int rc = peering_send (self, VTX_UDP_NOM, data, size, flags);

// Update counter and clean
self->vocket->outgoing++;
free (data);
return rc;
Expand Down Expand Up @@ -1296,7 +1275,7 @@ s_handle_io_error (char *reason)
|| errno == EPROTO
|| errno == ENOPROTOOPT
|| errno == EHOSTDOWN
|| errno == ENOENT
|| errno == ENONET
|| errno == EHOSTUNREACH
|| errno == EOPNOTSUPP
|| errno == ENETUNREACH
Expand Down

0 comments on commit e312afb

Please sign in to comment.