summaryrefslogtreecommitdiff
path: root/src/master.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-09-17 16:22:32 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2014-09-17 16:22:32 +0200
commit574f866a8af53006bb6422c1f63c39284ecd60ac (patch)
tree093a2b6c718bfce38fe7ea037e20d4156d017740 /src/master.c
parent237e7efb2964796a9ee4ca61905b7481f08efc08 (diff)
downloadbiruda-574f866a8af53006bb6422c1f63c39284ecd60ac.tar.gz
biruda-574f866a8af53006bb6422c1f63c39284ecd60ac.tar.bz2
more bugfixing
Diffstat (limited to 'src/master.c')
-rw-r--r--src/master.c8
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 );