diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-17 13:00:34 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-17 13:00:34 +0200 |
commit | f60fb626f809aaf91d9be77eca3f000d1081c0bb (patch) | |
tree | 8954ae052d454ffbf856e59b7abf000d9823bb46 /src/coordinator.c | |
parent | 6a996a2fcb97578a60142d5c9c36b867d24b7c56 (diff) | |
download | biruda-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.c | 9 |
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 ); + } } } |