summaryrefslogtreecommitdiff
path: root/src/coordinator.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-09-17 13:00:34 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2014-09-17 13:00:34 +0200
commitf60fb626f809aaf91d9be77eca3f000d1081c0bb (patch)
tree8954ae052d454ffbf856e59b7abf000d9823bb46 /src/coordinator.c
parent6a996a2fcb97578a60142d5c9c36b867d24b7c56 (diff)
downloadbiruda-f60fb626f809aaf91d9be77eca3f000d1081c0bb.tar.gz
biruda-f60fb626f809aaf91d9be77eca3f000d1081c0bb.tar.bz2
better error handling and termination on Ctrl-C
Diffstat (limited to 'src/coordinator.c')
-rw-r--r--src/coordinator.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/coordinator.c b/src/coordinator.c
index ce8060a..4403999 100644
--- a/src/coordinator.c
+++ b/src/coordinator.c
@@ -69,7 +69,14 @@ static void *coordinator_func( void *thread_data )
fprintf( stderr, "ERROR: truncated message!" );
}
json_object_put( obj );
-
+ }
+ if( bytes < 0 ) {
+ if( errno == EAGAIN || errno == EINTR ) {
+ continue;
+ } else {
+ fprintf( stderr, "ERROR: nn_recv returned %d: %s (%d)\n",
+ bytes, nn_strerror( errno ), errno );
+ }
}
}