diff --git a/x11/i3/Makefile b/x11/i3/Makefile index 281e3877382..48c315c9e27 100644 --- a/x11/i3/Makefile +++ b/x11/i3/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.55 2012/12/27 19:58:05 dcoppa Exp $ +# $OpenBSD: Makefile,v 1.56 2013/01/10 08:20:52 dcoppa Exp $ COMMENT = improved dynamic tiling window manager DISTNAME = i3-4.4 -REVISION = 1 +REVISION = 2 CATEGORIES = x11 EXTRACT_SUFX = .tar.bz2 diff --git a/x11/i3/patches/patch-libi3_ipc_send_message_c b/x11/i3/patches/patch-libi3_ipc_send_message_c new file mode 100644 index 00000000000..e5d8ee021fc --- /dev/null +++ b/x11/i3/patches/patch-libi3_ipc_send_message_c @@ -0,0 +1,41 @@ +$OpenBSD: patch-libi3_ipc_send_message_c,v 1.1 2013/01/10 08:20:52 dcoppa Exp $ + +From f5b7bfb12ef74ddbf250e5076bbfaafd0027474c Mon Sep 17 00:00:00 2001 +From: Michael Stapelberg +Date: Wed, 09 Jan 2013 17:11:03 +0000 +Subject: Bugfix: fix IPC messages writes with low buffer sizes (Thanks jasper, dcoppa) + +This fixes a problem where i3bar would exit due to malformed IPC +messages when switching between workspaces with some windows opened. + +--- libi3/ipc_send_message.c.orig Wed Dec 12 00:08:17 2012 ++++ libi3/ipc_send_message.c Thu Jan 10 09:07:13 2013 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + +@@ -38,14 +39,15 @@ int ipc_send_message(int sockfd, uint32_t message_size + memcpy(walk, payload, message_size); + + int sent_bytes = 0; +- int bytes_to_go = buffer_size; +- while (sent_bytes < bytes_to_go) { +- int n = write(sockfd, msg + sent_bytes, bytes_to_go); +- if (n == -1) ++ while (sent_bytes < buffer_size) { ++ int n = write(sockfd, msg + sent_bytes, buffer_size - sent_bytes); ++ if (n == -1) { ++ if (errno == EAGAIN) ++ continue; + return -1; ++ } + + sent_bytes += n; +- bytes_to_go -= n; + } + + return 0;