diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-01-29 13:12:39 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-01-30 20:56:09 -0500 |
commit | 3f9f73f33e39969c19f185177f4212c90eb68bbc (patch) | |
tree | 2742a5c66f533a89b33833232f54bd566276693e | |
parent | 5312f21af6b7066ed4d9c09c8192fe147bf49cc2 (diff) |
connection: Handle broken pipes in sendmsg
-rw-r--r-- | wayland/connection.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wayland/connection.c b/wayland/connection.c index f83979c..64d62db 100644 --- a/wayland/connection.c +++ b/wayland/connection.c @@ -265,10 +265,12 @@ wl_connection_data(struct wl_connection *connection, uint32_t mask) msg.msg_flags = 0; do { - len = sendmsg(connection->fd, &msg, 0); + len = sendmsg(connection->fd, &msg, MSG_NOSIGNAL); } while (len < 0 && errno == EINTR); - if (len < 0) { + if (len == -1 && errno == EPIPE) { + return -1; + } else if (len < 0) { fprintf(stderr, "write error for connection %p, fd %d: %m\n", connection, connection->fd); |