Merge pull request #530 from mikkeloscar/swaybar-kill-on-sway-crash

swaybar: Abort when receiving 0 bytes in IPC call
This commit is contained in:
Drew DeVault 2016-03-22 06:53:29 -04:00
commit a99970d7a3

View file

@ -47,7 +47,7 @@ struct ipc_response *ipc_recv_response(int socketfd) {
size_t total = 0;
while (total < ipc_header_size) {
ssize_t received = recv(socketfd, data + total, ipc_header_size - total, 0);
if (received < 0) {
if (received <= 0) {
sway_abort("Unable to receive IPC response");
}
total += received;