From: Kristian Høgsberg Date: Tue, 9 Dec 2008 15:47:36 +0000 (-0500) Subject: Handle interrupted system calls in connection code. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdea72a078f15740a86ea48ad2d479d29c68370a;p=platform%2Fupstream%2Fweston.git Handle interrupted system calls in connection code. --- diff --git a/connection.c b/connection.c index c6643a1..9d63f82 100644 --- a/connection.c +++ b/connection.c @@ -123,7 +123,9 @@ int wl_connection_data(struct wl_connection *connection, uint32_t mask) iov[1].iov_len = b->tail; count = 2; } - len = readv(connection->fd, iov, count); + do { + len = readv(connection->fd, iov, count); + } while (len < 0 && errno == EINTR); if (len < 0) { fprintf(stderr, "read error from connection %p: %m (%d)\n", @@ -166,7 +168,9 @@ int wl_connection_data(struct wl_connection *connection, uint32_t mask) iov[1].iov_len = b->head; count = 2; } - len = writev(connection->fd, iov, count); + do { + len = writev(connection->fd, iov, count); + } while (len < 0 && errno == EINTR); if (len < 0) { fprintf(stderr, "write error for connection %p: %m\n", connection); return -1;