summary refs log tree commit diff
path: root/bin/dtch.c
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-27 16:11:28 -0500
committerJune McEnroe <programble@gmail.com>2018-02-27 16:11:28 -0500
commita381a5f3a16c078c7759e324e92f029153891384 (patch)
tree438eada268be3e301194c6bc12a719bfc07ddf2a /bin/dtch.c
parentRemove jrp (diff)
downloadsrc-a381a5f3a16c078c7759e324e92f029153891384.tar.gz
src-a381a5f3a16c078c7759e324e92f029153891384.zip
Check revents with &
Diffstat (limited to 'bin/dtch.c')
-rw-r--r--bin/dtch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 6fe85838..8c174f82 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -223,7 +223,7 @@ static int atch(int argc, char *argv[]) {
         { .fd = pty, .events = POLLIN },
     };
     while (0 < poll(fds, 2, -1)) {
-        if (fds[0].revents == POLLIN) {
+        if (fds[0].revents & POLLIN) {
             ssize_t readSize = read(STDIN_FILENO, buf, sizeof(buf));
             if (readSize < 0) err(EX_IOERR, "read(%d)", STDIN_FILENO);
 
@@ -234,7 +234,7 @@ static int atch(int argc, char *argv[]) {
             if (writeSize < readSize) errx(EX_IOERR, "short write(%d)", pty);
         }
 
-        if (fds[1].revents == POLLIN) {
+        if (fds[1].revents & POLLIN) {
             ssize_t readSize = read(pty, buf, sizeof(buf));
             if (readSize < 0) err(EX_IOERR, "read(%d)", pty);