diff --git a/doc/Changelog b/doc/Changelog index 5b524539b..5676473e6 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 2 June 2016: Wouter - Fix libubound for edns optlist feature. - Fix distinction between free and CRYPTO_free in dsa and ecdsa alloc. + - Fix #752: retry resource temporarily unavailable on control pipe. 31 May 2016: Wouter - Fix windows service to be created run with limited rights, as a diff --git a/util/tube.c b/util/tube.c index e415427c5..e525f1ccd 100644 --- a/util/tube.c +++ b/util/tube.c @@ -304,6 +304,8 @@ int tube_write_msg(struct tube* tube, uint8_t* buf, uint32_t len, d = r; while(d != (ssize_t)sizeof(len)) { if((r=write(fd, ((char*)&len)+d, sizeof(len)-d)) == -1) { + if(errno == EAGAIN) + continue; /* temporarily unavail: try again*/ log_err("tube msg write failed: %s", strerror(errno)); (void)fd_set_nonblock(fd); return 0; @@ -313,6 +315,8 @@ int tube_write_msg(struct tube* tube, uint8_t* buf, uint32_t len, d = 0; while(d != (ssize_t)len) { if((r=write(fd, buf+d, len-d)) == -1) { + if(errno == EAGAIN) + continue; /* temporarily unavail: try again*/ log_err("tube msg write failed: %s", strerror(errno)); (void)fd_set_nonblock(fd); return 0;