]> git.lizzy.rs Git - bspwm.git/commitdiff
Revert "Only handle stdout closure for subscribers"
authorBastien Dejean <nihilhill@gmail.com>
Fri, 23 Oct 2020 19:25:27 +0000 (21:25 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 23 Oct 2020 19:25:27 +0000 (21:25 +0200)
This reverts commit 7aca1b6c4e550c1a5a5cea5cb20d9dd8d3190999.

Fixes #1212.

src/bspc.c
src/common.h
src/messages.c

index 1a99b5acc7a939f7cc39fbafd07b42c89dd02d6b..5dd807cd0da00ab34fae1d80f4633398f7d168c2 100644 (file)
@@ -79,7 +79,6 @@ int main(int argc, char *argv[])
        }
 
        int ret = EXIT_SUCCESS, nb;
-       bool subwait = false;
 
        struct pollfd fds[] = {
                {sock_fd, POLLIN, 0},
@@ -94,8 +93,6 @@ int main(int argc, char *argv[])
                                        ret = EXIT_FAILURE;
                                        fprintf(stderr, "%s", rsp + 1);
                                        fflush(stderr);
-                               } else if (rsp[0] == SUBSCRIBE_MESSAGE[0]) {
-                                       subwait = true;
                                } else {
                                        fprintf(stdout, "%s", rsp);
                                        fflush(stdout);
@@ -104,7 +101,7 @@ int main(int argc, char *argv[])
                                break;
                        }
                }
-               if (subwait && fds[1].revents & (POLLERR | POLLHUP)) {
+               if (fds[1].revents & (POLLERR | POLLHUP)) {
                        break;
                }
        }
index fa30cb11103147c4d445d782456058dbcbe7052a..f44eef88d8148e9307c6fc8457abfdec7cfba908 100644 (file)
@@ -28,7 +28,6 @@
 #define SOCKET_PATH_TPL  "/tmp/bspwm%s_%i_%i-socket"
 #define SOCKET_ENV_VAR   "BSPWM_SOCKET"
 
-#define FAILURE_MESSAGE   "\x07"
-#define SUBSCRIBE_MESSAGE "\x08"
+#define FAILURE_MESSAGE  "\x07"
 
 #endif
index f4c7064df2914b2b7ad0d686e174cd0bf8ce82a1..9d9f46786893e99aabecf528232d3f87571a692a 100644 (file)
@@ -1332,9 +1332,6 @@ void cmd_subscribe(char **args, int num, FILE *rsp)
                        perror("subscribe: fopen");
                        goto free_fifo_path;
                }
-       } else {
-               fprintf(rsp, SUBSCRIBE_MESSAGE);
-               fflush(rsp);
        }
 
        subscriber_list_t *sb = make_subscriber(stream, fifo_path, field, count);