diff options
Diffstat (limited to 'src/master.c')
-rw-r--r-- | src/master.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/master.c b/src/master.c index a73a7b1..6dc764a 100644 --- a/src/master.c +++ b/src/master.c @@ -41,7 +41,7 @@ NEXT_DISCOVER: int bytes = nn_send( master_sock, msg, msg_size, 0 ); if( bytes < 0 ) { if( errno == ETERM ) { - goto END; + goto MASTER_ENDS; } else { fprintf( stderr, "ERROR: nn_send returned %d: %s (%d)\n", bytes, nn_strerror( errno ), errno ); @@ -72,13 +72,17 @@ NEXT_DISCOVER: goto NEXT_DISCOVER; } else if( errno == EAGAIN || errno == EINTR ) { continue; + } else if( errno == ETERM ) { + master_must_terminate = 1; + continue; } else { fprintf( stderr, "ERROR: nn_recv returned %d: %s (%d)\n", bytes, nn_strerror( errno ), errno ); } } } -END: + +MASTER_ENDS: (void)nn_shutdown( master_sock, 0 ); |