diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-17 16:22:32 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-17 16:22:32 +0200 |
commit | 574f866a8af53006bb6422c1f63c39284ecd60ac (patch) | |
tree | 093a2b6c718bfce38fe7ea037e20d4156d017740 /src/coordinator.c | |
parent | 237e7efb2964796a9ee4ca61905b7481f08efc08 (diff) | |
download | biruda-574f866a8af53006bb6422c1f63c39284ecd60ac.tar.gz biruda-574f866a8af53006bb6422c1f63c39284ecd60ac.tar.bz2 |
more bugfixing
Diffstat (limited to 'src/coordinator.c')
-rw-r--r-- | src/coordinator.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/coordinator.c b/src/coordinator.c index 77ff484..57642be 100644 --- a/src/coordinator.c +++ b/src/coordinator.c @@ -43,7 +43,6 @@ static void *coordinator_func( void *thread_data ) char *answer = NULL; int bytes = nn_recv( coordinator_sock, &answer, NN_MSG, 0 ); - if( bytes == ETIMEDOUT ) continue; if( coordinator_must_terminate ) continue; if( bytes >= 0 ) { printf( "coordinator received: %s\n", answer ); @@ -67,7 +66,8 @@ static void *coordinator_func( void *thread_data ) bytes = nn_send( coordinator_sock, msg, msg_size, 0 ); if( bytes < 0 ) { if( errno == ETERM ) { - goto END; + coordinator_must_terminate = 1; + continue; } else { fprintf( stderr, "ERROR: nn_send returned %d: %s (%d)\n", bytes, nn_strerror( errno ), errno ); @@ -81,6 +81,9 @@ static void *coordinator_func( void *thread_data ) if( bytes < 0 ) { if( errno == EAGAIN || errno == EINTR ) { continue; + } else if( errno == ETERM ) { + coordinator_must_terminate = 1; + continue; } else { fprintf( stderr, "ERROR: nn_recv returned %d: %s (%d)\n", bytes, nn_strerror( errno ), errno ); @@ -88,7 +91,6 @@ static void *coordinator_func( void *thread_data ) } } - END: (void)nn_shutdown( coordinator_sock, 0 ); puts( "coordinator disconnected" ); |