commit 95228a60c30fb237075d22213c2cb241af259c1f
parent ddeeb5b062f0e611a54f1a9af28efc641a3d33af
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date: Mon, 28 Nov 2016 21:49:53 +0100
add error check for poll(2)
Diffstat:
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) {