]> git.lizzy.rs Git - bspwm.git/commitdiff
Handle standard output closure last
authorBastien Dejean <nihilhill@gmail.com>
Mon, 12 Oct 2020 13:40:57 +0000 (15:40 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Mon, 12 Oct 2020 13:40:57 +0000 (15:40 +0200)
Fixes #1207.

src/bspc.c

index c6e49f7a76473b50735e0c7ebaf160ba2f7b97e4..5dd807cd0da00ab34fae1d80f4633398f7d168c2 100644 (file)
@@ -86,9 +86,6 @@ int main(int argc, char *argv[])
        };
 
        while (poll(fds, 2, -1) > 0) {
-               if (fds[1].revents & (POLLERR | POLLHUP)) {
-                       break;
-               }
                if (fds[0].revents & POLLIN) {
                        if ((nb = recv(sock_fd, rsp, sizeof(rsp)-1, 0)) > 0) {
                                rsp[nb] = '\0';
@@ -104,6 +101,9 @@ int main(int argc, char *argv[])
                                break;
                        }
                }
+               if (fds[1].revents & (POLLERR | POLLHUP)) {
+                       break;
+               }
        }
 
        close(sock_fd);