]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add a little extra diagnostic to nno-blocking write
authorMike Brady <mikebrady@eircom.net>
Mon, 23 May 2016 15:43:02 +0000 (16:43 +0100)
committerMike Brady <mikebrady@eircom.net>
Mon, 23 May 2016 15:43:02 +0000 (16:43 +0100)
common.c

index d7c32f2f69999bccbbc0c78833e54e06c5f87057..b4d9583975884f5119932c8584bee464ad508c32 100644 (file)
--- a/common.c
+++ b/common.c
@@ -524,13 +524,15 @@ ssize_t non_blocking_write(int fd, const void *buf, size_t count) {
     ufds[0].events = POLLOUT;
     rc = poll(ufds, 1, config.metadata_pipe_timeout);
     if (rc < 0) {
-      debug(1, "error waiting for pipe to become ready for writing...");
+      debug(1, "non-blocking write error waiting for pipe to become ready for writing...");
     } else if (rc == 0) {
-      warn("timeout waiting for pipe to become ready for writing");
+      warn("non-blocking write timeout waiting for pipe to become ready for writing");
       rc = -2;
     } else { //rc > 0, implying it might be ready
        size_t bytes_written = write(fd,ibuf,bytes_remaining);
        if (bytes_written==-1) {
+               if (errno==EINTR)
+                       debug(1,"non-blocking write interrupted by a signal interrupt");
                if (!((errno == EAGAIN) || (errno == EWOULDBLOCK)))
                        rc = -1;
        } else {