Introduction
Introduction Statistics Contact Development Disclaimer Help
ptty: better error handling - scroll - scrollbackbuffer program for st
git clone git://git.suckless.org/scroll
Log
Files
Refs
README
LICENSE
---
commit 5497edaec0dbb2b49ba643e834c0de336b56a603
parent da549bbe4627628c229b9b3e77448aa3bae04bd2
Author: Jan Klemkow <[email protected]>
Date: Thu, 16 Apr 2020 20:59:41 +0200
ptty: better error handling
Diffstat:
M ptty.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/ptty.c b/ptty.c
@@ -111,9 +111,8 @@ main(int argc, char *argv[])
if ((n = read(STDIN_FILENO, buf, sizeof buf)) == -1)
die("read:");
if (n == 0) {
- close(mfd);
- //pfds = 1;
pfd[0].fd = -1;
+ close(mfd);
break;
}
if (write(mfd, buf, n) == -1)
@@ -129,9 +128,9 @@ main(int argc, char *argv[])
}
if (pfd[0].revents & POLLHUP) {
- //pfds = 1;
pfd[0].fd = -1;
close(mfd);
+ break;
}
if (pfd[1].revents & POLLHUP)
break;
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.