[runtime] Fixed interruptible wapi_sendfile part2.
authorMarcos Henrich <marcos.henrich@xamarin.com>
Thu, 9 Jun 2016 11:42:15 +0000 (12:42 +0100)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Thu, 9 Jun 2016 11:42:15 +0000 (12:42 +0100)
Fixed issue where underlying system without HAVE_SENDFILE
would not interrupt while sending a file even when the socket was
set as a non blocking one.

mono/io-layer/sockets.c

index 6d0da527bd65c54a31c77c2f1b0255c0d43add1a..4785e1504e3ff98e895c17cb68e6296bf75dd171 100644 (file)
@@ -996,7 +996,7 @@ wapi_sendfile (guint32 socket, gpointer fd, guint32 bytes_to_write, guint32 byte
                do {
                        n = send (socket, buffer, n, 0); /* short sends? enclose this in a loop? */
                } while (n == -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
-       } while (n != -1);
+       } while (n != -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
 
        if (n == -1) {
                gint errnum = errno;