add error check for poll(2) - lchat - A line oriented chat front end for ii. | |
git clone git://git.suckless.org/lchat | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 95228a60c30fb237075d22213c2cb241af259c1f | |
parent ddeeb5b062f0e611a54f1a9af28efc641a3d33af | |
Author: Jan Klemkow <[email protected]> | |
Date: Mon, 28 Nov 2016 21:49:53 +0100 | |
add error check for poll(2) | |
Diffstat: | |
M lchat.c | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/lchat.c b/lchat.c | |
@@ -279,7 +279,8 @@ main(int argc, char *argv[]) | |
fputs(prompt, stdout); | |
for (;;) { | |
- poll(pfd, 2, INFTIM); | |
+ if (poll(pfd, 2, INFTIM) == -1) | |
+ err(EXIT_FAILURE, "poll"); | |
/* moves cursor back after linewrap */ | |
if (loverhang > 0) { |